Skip to content

Commit

Permalink
KWSys: Cleanup putenv leak option implementation
Browse files Browse the repository at this point in the history
Define KWSYS_DO_NOT_CLEAN_PUTENV only for the implementation.  It does
not need to be configured in the interface of "Configure.hxx".
  • Loading branch information
bradking committed Jun 29, 2010
1 parent 7e124fe commit 00b45e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
15 changes: 9 additions & 6 deletions Utilities/kwsys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 0 additions & 9 deletions Utilities/kwsys/Configure.hxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@

Expand Down

0 comments on commit 00b45e0

Please sign in to comment.