summaryrefslogtreecommitdiffstats
path: root/Tests/Module
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2011-08-13 20:20:54 (GMT)
committerStephen Kelly <steveire@gmail.com>2011-08-13 20:57:55 (GMT)
commitc448b09ad39c35b129d7b91710bea4f26fabdfe4 (patch)
tree8e58f1d0c6f4ab10f7c1403a860d1eea133f239f /Tests/Module
parentfb88c6e32ad78895c45b4651748e45a388a81cb0 (diff)
downloadCMake-c448b09ad39c35b129d7b91710bea4f26fabdfe4.zip
CMake-c448b09ad39c35b129d7b91710bea4f26fabdfe4.tar.gz
CMake-c448b09ad39c35b129d7b91710bea4f26fabdfe4.tar.bz2
Perform the -Werror test only once.
This way, the output of the test should be visible on CDash.
Diffstat (limited to 'Tests/Module')
-rw-r--r--Tests/Module/GenerateExportHeader/CMakeLists.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index a310eb9..46ab885 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.8.5 FATAL_ERROR)
project(GenerateExportHeader)
+include(CheckCXXCompilerFlag)
+
set( CMAKE_INCLUDE_CURRENT_DIR ON )
macro(TEST_FAIL value msg)
@@ -16,6 +18,8 @@ macro(TEST_PASS value msg)
endif ()
endmacro()
+check_cxx_compiler_flag(-Werror HAS_WERROR_FLAG)
+
# We seem to get race conditions is writing this stuff to the same file at least on MinGW
# So to write to separate source and build directories, we use a count to differentiate.
set (COUNT 0)
@@ -46,9 +50,7 @@ macro(_do_build Include Library LibrarySource Source)
"add_compiler_export_flags()\n"
- "check_cxx_compiler_flag(-Werror HAS_WERROR_FLAG)\n"
-
- "if(HAS_WERROR_FLAG)\n"
+ "if(${HAS_WERROR_FLAG})\n"
" add_definitions(-Werror)\n"
"else()\n"
" if(MSVC AND COMPILER_HAS_DEPRECATED)\n"
@@ -101,6 +103,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
message("#### COMPILER_HAS_DEPRECATED: " ${COMPILER_HAS_DEPRECATED})
message("#### COMPILER_HAS_HIDDEN_VISIBILITY: " ${COMPILER_HAS_HIDDEN_VISIBILITY})
message("#### WIN32: " ${WIN32})
+message("#### HAS_WERROR_FLAG: " ${HAS_WERROR_FLAG})
set(link_libraries)
macro(macro_add_test_library name)