mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
extended compiler-standard check to check for CMP0067 policy
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
f865064e56
commit
aec3afbcec
1 changed files with 11 additions and 4 deletions
|
@ -92,10 +92,17 @@ endif()
|
|||
|
||||
# Set compiler standard to C++ 11, appending to CMAKE_CXX_FLAGS is done so that try_compile() is
|
||||
# also affected, which KDE uses for visibility check for an example
|
||||
if(KATIE_COMPILER STREQUAL "gcc")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
elseif(KATIE_COMPILER STREQUAL "clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
if(NOT CMAKE_VERSION VERSION_LESS "3.8.0")
|
||||
cmake_policy(GET CMP0067 trycompilestandardpolicy)
|
||||
else()
|
||||
set(trycompilestandardpolicy OLD)
|
||||
endif()
|
||||
if(NOT trycompilestandardpolicy EQUAL NEW)
|
||||
if(KATIE_COMPILER STREQUAL "gcc")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
|
||||
elseif(KATIE_COMPILER STREQUAL "clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT CMAKE_VERSION VERSION_LESS "3.1.0")
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
|
Loading…
Add table
Reference in a new issue