Browse Source

KWSys: Cleanup putenv leak option implementation

Define KWSYS_DO_NOT_CLEAN_PUTENV only for the implementation.  It does
not need to be configured in the interface of "Configure.hxx".
Brad King 15 years ago
parent
commit
d2222d529d
2 changed files with 9 additions and 15 deletions
  1. 9 6
      Source/kwsys/CMakeLists.txt
  2. 0 9
      Source/kwsys/Configure.hxx.in

+ 9 - 6
Source/kwsys/CMakeLists.txt

@@ -141,12 +141,6 @@ IF(COMMAND SET_PROPERTY)
     "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>"
     )
 ENDIF(COMMAND SET_PROPERTY)
-# add option to disable memory cleanup at exit of putenv memory
-IF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
-  SET(KWSYS_DO_NOT_CLEAN_PUTENV 1)
-ELSE(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
-  SET(KWSYS_DO_NOT_CLEAN_PUTENV 0)
-ENDIF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV)
 
 # Select library components.
 IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
@@ -604,6 +598,15 @@ ELSE(KWSYS_BUILD_SHARED)
   SET(KWSYS_LIBRARY_TYPE STATIC)
 ENDIF(KWSYS_BUILD_SHARED)
 
+#-----------------------------------------------------------------------------
+# Configure some implementation details.
+
+IF(KWSYS_DO_NOT_CLEAN_PUTENV)
+  # Disable cleanup of putenv memory for issues with GCOV.
+  SET_SOURCE_FILES_PROPERTIES(SystemTools.cxx PROPERTIES
+    COMPILE_FLAGS -DKWSYS_DO_NOT_CLEAN_PUTENV=1)
+ENDIF(KWSYS_DO_NOT_CLEAN_PUTENV)
+
 #-----------------------------------------------------------------------------
 # Choose a directory for the generated headers.
 IF(NOT KWSYS_HEADER_ROOT)

+ 0 - 9
Source/kwsys/Configure.hxx.in

@@ -15,15 +15,6 @@
 /* Include C configuration.  */
 #include <@KWSYS_NAMESPACE@/Configure.h>
 
-/* Disable cleanup of putenv memory for issues with GCOV */
-#if @KWSYS_DO_NOT_CLEAN_PUTENV@
-#define KWSYS_DO_NOT_CLEAN_PUTENV 
-#else
-#undef KWSYS_DO_NOT_CLEAN_PUTENV
-#endif
-
-
-
 /* Whether ANSI C++ stream headers are to be used.  */
 #define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@