Merge topic 'WriteCompilerDetectionHeader-tests'

3c0996c1 WCDH: Test that no C compiler features are defined for CXX compiler.
8dc0c976 WCDH: Fix the C_STANDARD property in the tests.
This commit is contained in:
Brad King 2015-01-22 09:50:38 -05:00 committed by CMake Topic Stage
commit 529293e344
3 changed files with 9 additions and 1 deletions

View File

@ -71,7 +71,7 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU"
OR CMAKE_C_COMPILER_ID STREQUAL "Clang"
OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
add_executable(C_undefined c_undefined.c)
set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90)
set_property(TARGET C_undefined PROPERTY C_STANDARD 90)
target_compile_options(C_undefined PRIVATE -Werror=undef)
endif()

View File

@ -4,6 +4,10 @@
#define PREFIX TEST
#include "compile_tests.h"
#ifdef TEST_COMPILER_C_STATIC_ASSERT
#error Expect no C features defined
#endif
int main()
{
return 0;

View File

@ -4,6 +4,10 @@
#define PREFIX MULTI
#include "compile_tests.h"
#ifdef MULTI_COMPILER_C_STATIC_ASSERT
#error Expect no C features defined
#endif
int main()
{
return 0;