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".
This commit is contained in:
Brad King 2010-06-29 08:44:33 -04:00
parent 198e00f6e8
commit d2222d529d
2 changed files with 9 additions and 15 deletions

View File

@ -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)

View File

@ -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@