[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.144 1.145 String.c 1.1 1.2 kwsysPrivate.h 1.6 1.7

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jun 10 11:46:08 EDT 2009


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv31202/Source/kwsys

Modified Files:
	CMakeLists.txt String.c kwsysPrivate.h 
Log Message:
COMP: Avoid String.c inclusion by Compaq templates

The Compaq compiler (on VMS) includes 'String.c' in source files that
use the stl string while looking for template definitions.  This was the
true cause of double-inclusion of the 'kwsysPrivate.h' header.  We work
around the problem by conditionally compiling the entire source file on
a condition only true when really building the source.


Index: kwsysPrivate.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/kwsysPrivate.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** kwsysPrivate.h	14 May 2009 13:27:02 -0000	1.6
--- kwsysPrivate.h	10 Jun 2009 15:46:06 -0000	1.7
***************
*** 40,45 ****
  
  #else
! # ifndef __VMS /* Avoid strange false positive on VMS compiler.  */
! #  error "kwsysPrivate.h included multiple times."
! # endif
  #endif
--- 40,43 ----
  
  #else
! # error "kwsysPrivate.h included multiple times."
  #endif

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/CMakeLists.txt,v
retrieving revision 1.144
retrieving revision 1.145
diff -C 2 -d -r1.144 -r1.145
*** CMakeLists.txt	13 Feb 2009 20:49:52 -0000	1.144
--- CMakeLists.txt	10 Jun 2009 15:46:05 -0000	1.145
***************
*** 849,852 ****
--- 849,858 ----
  ADD_DEFINITIONS("-DKWSYS_NAMESPACE=${KWSYS_NAMESPACE}")
  
+ IF(KWSYS_USE_String)
+   # Activate code in "String.c".  See the comment in the source.
+   SET_SOURCE_FILES_PROPERTIES(String.c PROPERTIES
+     COMPILE_FLAGS "-DKWSYS_STRING_C")
+ ENDIF(KWSYS_USE_String)
+ 
  #-----------------------------------------------------------------------------
  # Process execution on windows needs to build a forwarding executable

Index: String.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/String.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** String.c	11 Dec 2007 16:36:57 -0000	1.1
--- String.c	10 Jun 2009 15:46:06 -0000	1.2
***************
*** 12,15 ****
--- 12,23 ----
  
  =========================================================================*/
+ #ifdef KWSYS_STRING_C
+ /*
+ All code in this source file is conditionally compiled to work-around
+ template definition auto-search on VMS.  Other source files in this
+ directory that use the stl string cause the compiler to load this
+ source to try to get the definition of the string template.  This
+ condition blocks the compiler from seeing the symbols defined here.
+ */
  #include "kwsysPrivate.h"
  #include KWSYS_HEADER(String.h)
***************
*** 106,107 ****
--- 114,117 ----
  #endif
  }
+ 
+ #endif /* KWSYS_STRING_C */



More information about the Cmake-commits mailing list