Add release option in CMakeLists.txt

This commit is contained in:
antao 2018-09-03 14:42:44 +08:00
parent 667731d370
commit e6d4e975dc
2 changed files with 6 additions and 4 deletions

View File

@ -57,9 +57,11 @@ if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
set(CMAKE_CXX_FLAGS "-std=${CMAKE_CXX_STD_FLAGS} -g -Wall -fpermissive ${CMAKE_CXX_FLAGS}")
if (RELEASE STREQUAL YES)
set(CMAKE_CXX_FLAGS "-std=${CMAKE_CXX_STD_FLAGS} -O2 -Wall -fpermissive ${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "-std=${CMAKE_CXX_STD_FLAGS} -g -Wall -fpermissive ${CMAKE_CXX_FLAGS}")
endif()
#string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
MESSAGE(STATUS ${CMAKE_CXX_FLAGS})

@ -1 +1 @@
Subproject commit 18ebe227f27d924e196cce96841c877128124e8f
Subproject commit 1a64a89e0741e467a16b5e459291caf225d36250