From 5601afe384c61914cce3f2bae84a9d52ca8b2df5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 29 Apr 2004 17:44:52 -0400 Subject: [PATCH] ENH: Added automatic adjustment of C++ flags to include -timplicit_local and -no_implicit_include for the Compaq compiler on OSF. --- Source/kwsys/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index e6bb3f25a..42b0b22fe 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -116,6 +116,23 @@ IF(CMAKE_ANSI_CFLAGS) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") ENDIF(CMAKE_ANSI_CFLAGS) +#----------------------------------------------------------------------------- +# Adjust compiler flags for some platforms. +IF(NOT CMAKE_COMPILER_IS_GNUCXX) + IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") + STRING(REGEX MATCH "-timplicit_local" + KWSYS_CXX_FLAGS_HAVE_IMPLICIT_LOCAL "${CMAKE_CXX_FLAGS}") + STRING(REGEX MATCH "-no_implicit_include" + KWSYS_CXX_FLAGS_HAVE_NO_IMPLICIT_INCLUDE "${CMAKE_CXX_FLAGS}") + IF(NOT KWSYS_CXX_FLAGS_HAVE_IMPLICIT_LOCAL) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local") + ENDIF(NOT KWSYS_CXX_FLAGS_HAVE_IMPLICIT_LOCAL) + IF(NOT KWSYS_CXX_FLAGS_HAVE_NO_IMPLICIT_INCLUDE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no_implicit_include") + ENDIF(NOT KWSYS_CXX_FLAGS_HAVE_NO_IMPLICIT_INCLUDE) + ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") +ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) + #----------------------------------------------------------------------------- # Configure the standard library header wrappers based on compiler's # capabilities and parent project's request. Enforce 0/1 as only