Merge topic 'minor-cleanups'

f6f10954 Features: Use the features symbol in the feature-test compile.
5c04dfe4 Features: Only require AppleClang policy to be NEW on APPLE.
This commit is contained in:
Brad King 2014-05-16 10:21:08 -04:00 committed by CMake Topic Stage
commit 61856c8011
2 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ if(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
endif() endif()
cmake_policy(GET CMP0025 appleClangPolicy) cmake_policy(GET CMP0025 appleClangPolicy)
if(NOT appleClangPolicy STREQUAL NEW) if(APPLE AND NOT appleClangPolicy STREQUAL NEW)
return() return()
endif() endif()

View File

@ -20,7 +20,7 @@ macro(record_compiler_features lang compile_flags feature_list)
endif() endif()
endforeach() endforeach()
file(APPEND "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" file(APPEND "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}"
"\n};\n\nint main() { return 0; }\n") "\n};\n\nint main(int argc, char** argv) { (void)argv; return features[argc]; }\n")
try_compile(CMAKE_${lang}_FEATURE_TEST try_compile(CMAKE_${lang}_FEATURE_TEST
${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" ${CMAKE_BINARY_DIR} "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}"