clean-up cmake

This commit is contained in:
neargye 2019-03-21 16:05:37 +05:00
parent 9bc9c116ca
commit 0ed1f2cd86
2 changed files with 7 additions and 3 deletions

View file

@ -1,4 +1,6 @@
include_directories(${CMAKE_SOURCE_DIR}/include) include(CheckCXXCompilerFlag)
include_directories(${CMAKE_SOURCE_DIR}/include)
set(OPTIONS "") set(OPTIONS "")
@ -8,7 +10,8 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clan
set(OPTIONS ${OPTIONS} -std=c++17) set(OPTIONS ${OPTIONS} -std=c++17)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(OPTIONS /W4) set(OPTIONS /W4)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.11) check_cxx_compiler_flag(/permissive HAS_PERMISSIVE_FLAG)
if(HAS_PERMISSIVE_FLAG)
set(OPTIONS ${OPTIONS} /permissive-) set(OPTIONS ${OPTIONS} /permissive-)
endif() endif()
set(OPTIONS ${OPTIONS} /std:c++17) set(OPTIONS ${OPTIONS} /std:c++17)

View file

@ -9,7 +9,8 @@ set(OPTIONS "")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(OPTIONS /W4) set(OPTIONS /W4)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.11) check_cxx_compiler_flag(/permissive HAS_PERMISSIVE_FLAG)
if(HAS_PERMISSIVE_FLAG)
set(OPTIONS ${OPTIONS} /permissive-) set(OPTIONS ${OPTIONS} /permissive-)
endif() endif()
set(OPTIONS ${OPTIONS} /wd4702) # Disable warning C4702: unreachable code set(OPTIONS ${OPTIONS} /wd4702) # Disable warning C4702: unreachable code