Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
turn off deprecation warning if glog needs so
Browse files Browse the repository at this point in the history
Summary:
This addresses #162 for thatguymike
Closes #172

Differential Revision: D4620982

Pulled By: Yangqing

fbshipit-source-id: df3ef45f2c95418c538baa65d5dde3755cb25d1c
  • Loading branch information
Yangqing authored and facebook-github-bot committed Feb 27, 2017
1 parent 828498d commit e53b0c6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions cmake/MiscCheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,23 @@ else()
add_definitions(-DCAFFE2_NO_BUILTIN_CPU_SUPPORTS)
endif()

# Note(jiayq): on ubuntu 14.04, the default glog install uses ext/hash_set that
# is being deprecated. As a result, we will test if this is the environment we
# are building under. If yes, we will turn off deprecation warning for a
# cleaner build output.
CHECK_CXX_SOURCE_COMPILES(
"#include <glog/stl_logging.h>
int main(int argc, char** argv) {
return 0;
}" CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING
FAIL_REGEX ".*-Wno-deprecated.*")

if(NOT CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING)
message(STATUS "Turning off deprecation warning due to glog.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
endif()

# ---[ If we are using msvc, set no warning flags
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
message(STATUS "Adding no warning argument to the compiler")

endif()
endif()

0 comments on commit e53b0c6

Please sign in to comment.