Define an empty string in CMAKE_<LANG>_STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the <LANG>_STANDARD[_REQUIRED] properties will have no effect. Update the RunCMake.CompileFeatures test to exclude the LinkImplementationFeatureCycle test when there is no standard default. It can never fail because no use of specific features will adjust the CXX_STANDARD level required for any target since the standard levels have no meaning in this case.
61 lines
1.7 KiB
CMake
61 lines
1.7 KiB
CMake
include(RunCMake)
|
|
|
|
run_cmake(NotAFeature)
|
|
run_cmake(NotAFeatureGenex)
|
|
run_cmake(NotAFeatureTransitive)
|
|
run_cmake(NotAFeature_OriginDebug)
|
|
run_cmake(NotAFeature_OriginDebugGenex)
|
|
run_cmake(NotAFeature_OriginDebugTransitive)
|
|
run_cmake(NotAFeature_OriginDebugCommand)
|
|
|
|
run_cmake(generate_feature_list)
|
|
file(READ
|
|
"${RunCMake_BINARY_DIR}/generate_feature_list-build/c_features.txt"
|
|
C_FEATURES
|
|
)
|
|
file(READ
|
|
"${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_features.txt"
|
|
CXX_FEATURES
|
|
)
|
|
include("${RunCMake_BINARY_DIR}/generate_feature_list-build/c_standard_default.cmake")
|
|
include("${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx_standard_default.cmake")
|
|
|
|
if (NOT C_FEATURES)
|
|
run_cmake(NoSupportedCFeatures)
|
|
run_cmake(NoSupportedCFeaturesGenex)
|
|
endif()
|
|
|
|
if (NOT CXX_FEATURES)
|
|
run_cmake(NoSupportedCxxFeatures)
|
|
run_cmake(NoSupportedCxxFeaturesGenex)
|
|
else()
|
|
if(CXX_STANDARD_DEFAULT)
|
|
run_cmake(LinkImplementationFeatureCycle)
|
|
endif()
|
|
run_cmake(LinkImplementationFeatureCycleSolved)
|
|
|
|
if (";${CXX_FEATURES};" MATCHES ";cxx_final;")
|
|
set(RunCMake_TEST_OPTIONS "-DHAVE_FINAL=1")
|
|
endif()
|
|
run_cmake(NonValidTarget1)
|
|
run_cmake(NonValidTarget2)
|
|
unset(RunCMake_TEST_OPTIONS)
|
|
endif()
|
|
|
|
if(CXX_STANDARD_DEFAULT)
|
|
foreach(standard 98 11)
|
|
file(READ
|
|
"${RunCMake_BINARY_DIR}/generate_feature_list-build/cxx${standard}_flag.txt"
|
|
CXX${standard}_FLAG
|
|
)
|
|
if (CXX${standard}_FLAG STREQUAL NOTFOUND)
|
|
run_cmake(RequireCXX${standard})
|
|
run_cmake(RequireCXX${standard}Variable)
|
|
endif()
|
|
if (CXX${standard}EXT_FLAG STREQUAL NOTFOUND)
|
|
run_cmake(RequireCXX${standard}Ext)
|
|
run_cmake(RequireCXX${standard}ExtVariable)
|
|
endif()
|
|
endforeach()
|
|
endif()
|