Skip to content

Commit

Permalink
Change standard to c++14 to be compatible to tensorpipe's dependencies (
Browse files Browse the repository at this point in the history
dmlc#3712)

Co-authored-by: Jinjing Zhou <[email protected]>
  • Loading branch information
nv-dlasalle and VoVAllen authored Feb 7, 2022
1 parent 25c9221 commit 3512207
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ if(MSVC)
endif()
else(MSVC)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11)
# tensorpipe's dependencies require C++14
check_cxx_compiler_flag("-std=c++14" SUPPORT_CXX14)
set(CMAKE_C_FLAGS "-O2 -Wall -fPIC ${CMAKE_C_FLAGS}")
# We still use c++11 flag in CPU build because gcc5.4 (our default compiler) is
# not fully compatible with c++14 feature.
set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -std=c++11 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -std=c++14 ${CMAKE_CXX_FLAGS}")
if(NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--warn-common ${CMAKE_SHARED_LINKER_FLAGS}")
endif(NOT APPLE)
Expand Down

0 comments on commit 3512207

Please sign in to comment.