From a7098d1433582bb5c8c14c7dcf90053528d8b590 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 21 Nov 2002 14:11:53 -0500 Subject: move ansi cxx flags stuff out of try compile and into cmake files --- Modules/CheckIncludeFileCXX.cmake | 1 + Modules/TestForANSIForScope.cmake | 3 ++- Modules/TestForANSIStreamHeaders.cmake | 3 ++- Modules/TestForSTDNamespace.cmake | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Modules') diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake index 7295f66a6e..f8ce1302d4 100644 --- a/Modules/CheckIncludeFileCXX.cmake +++ b/Modules/CheckIncludeFileCXX.cmake @@ -13,6 +13,7 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE) TRY_COMPILE(${VARIABLE} ${PROJECT_BINARY_DIR} ${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS} OUTPUT_VARIABLE OUTPUT) IF(${VARIABLE}) SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}") diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake index 3265f007d9..58d78eeaea 100644 --- a/Modules/TestForANSIForScope.cmake +++ b/Modules/TestForANSIForScope.cmake @@ -7,7 +7,8 @@ IF(NOT CMAKE_ANSI_FOR_SCOPE) MESSAGE(STATUS "Check for ANSI scope") TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${PROJECT_BINARY_DIR} - ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx) + ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS}) IF (CMAKE_ANSI_FOR_SCOPE) MESSAGE(STATUS "Check for ANSI scope - found") SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake index 7ea10711c4..74fe8316f2 100644 --- a/Modules/TestForANSIStreamHeaders.cmake +++ b/Modules/TestForANSIStreamHeaders.cmake @@ -7,7 +7,8 @@ IF(NOT CMAKE_NO_ANSI_STREAM_HEADERS) MESSAGE(STATUS "Check for ANSI stream headers") TRY_COMPILE(CMAKE_ANSI_STREAM_HEADERS ${PROJECT_BINARY_DIR} - ${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cxx) + ${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cxx + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS}) IF (CMAKE_ANSI_STREAM_HEADERS) MESSAGE(STATUS "Check for ANSI stream headers - found") SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake index 9f145589bd..3fd018bbe9 100644 --- a/Modules/TestForSTDNamespace.cmake +++ b/Modules/TestForSTDNamespace.cmake @@ -7,6 +7,7 @@ IF(NOT CMAKE_STD_NAMESPACE) MESSAGE(STATUS "Check for STD namespace") TRY_COMPILE(CMAKE_STD_NAMESPACE ${PROJECT_BINARY_DIR} + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS} ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx) IF (CMAKE_STD_NAMESPACE) MESSAGE(STATUS "Check for STD namespace - found") -- cgit v1.2.1