extended compiler-standard check to check for CMP0067 policy

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-12-30 00:51:31 +00:00
parent f865064e56
commit aec3afbcec

View file

@ -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)