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

Commit

Permalink
Simplify C++ flags (#17413)
Browse files Browse the repository at this point in the history
"Only add c++11 flags and definitions after cuda compiling" is not true anymore
  • Loading branch information
leezu authored Jan 29, 2020
1 parent 910c608 commit 5631c13
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,15 @@ else()
if(SUPPORT_CXX14)
add_definitions(-DDMLC_USE_CXX11=1)
add_definitions(-DDMLC_USE_CXX14=1)
add_definitions(-DMSHADOW_IN_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(SUPPORT_CXX11)
add_definitions(-DDMLC_USE_CXX11=1)
add_definitions(-DMSHADOW_IN_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(SUPPORT_CXX0X)
add_definitions(-DDMLC_USE_CXX11=1)
add_definitions(-DMSHADOW_IN_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
endif(MSVC)
Expand Down Expand Up @@ -671,13 +674,7 @@ if(USE_PLUGIN_CAFFE)
endif()
endif()

if(NOT MSVC)
# Only add c++11 flags and definitions after cuda compiling
add_definitions(-DDMLC_USE_CXX11)
add_definitions(-DMSHADOW_IN_CXX11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
if(MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /EHsc")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHsc /Gy")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /EHsc /Gy")
Expand Down

0 comments on commit 5631c13

Please sign in to comment.