diff options
Diffstat (limited to 'Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake')
-rw-r--r-- | Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake index 276158c..64a961e 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagC.cmake @@ -18,6 +18,15 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU|LCC|Clang" AND NOT "x${CMAKE_C_SIMULATE_ID}" if(NOT SHOULD_WORK) message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-x c' check failed") endif() + + block() + # Test tolerating a flag that is not used when driving the linker. + string(APPEND CMAKE_C_FLAGS " -nostdinc") + check_compiler_flag(C "-x c" SHOULD_WORK_NOSTDINC) + if(NOT SHOULD_WORK_NOSTDINC) + message(SEND_ERROR "${CMAKE_C_COMPILER_ID} compiler flag '-x c -nostdinc' check failed") + endif() + endblock() endif() if(CMAKE_C_COMPILER_ID STREQUAL "GNU") # LCC C compiler silently ignore -frtti instead of failing, so skip it here. |