[Pcre-svn] [533] code/trunk: Update patch for MSVC static c…

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [533] code/trunk: Update patch for MSVC static compilation ( see Bugzilla #1681).
Revision: 533
          http://www.exim.org/viewvc/pcre2?view=rev&revision=533
Author:   ph10
Date:     2016-06-24 10:07:15 +0100 (Fri, 24 Jun 2016)
Log Message:
-----------
Update patch for MSVC static compilation (see Bugzilla #1681).


Modified Paths:
--------------
    code/trunk/CMakeLists.txt
    code/trunk/ChangeLog


Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt    2016-06-22 19:23:33 UTC (rev 532)
+++ code/trunk/CMakeLists.txt    2016-06-24 09:07:15 UTC (rev 533)
@@ -71,7 +71,9 @@
 # 2015-07-16 PH updated for new pcre2_find_bracket source module
 # 2015-08-24 PH correct C_FLAGS setting (patch from Roy Ivy III)
 # 2015-10=16 PH added support for never-backslash-C
-# 2016-03-01 PH appliced Chris Wilson's patch for MSVC static
+# 2016-03-01 PH applied Chris Wilson's patch for MSVC static
+# 2016-06-24 PH applied Chris Wilson's second patch, putting the first under
+#            a new option instead of being unconditional.


PROJECT(PCRE2 C)

@@ -188,6 +190,9 @@
ENDIF(MINGW)

 IF(MSVC)
+  OPTION(PCRE_STATIC_RUNTIME OFF CACHE BOOL
+    "ON=Compile against the static runtime (/MT)."
+    OFF)
   OPTION(INSTALL_MSVC_PDB
          "ON=Install .pdb files built by MSVC, if generated"
          OFF)
@@ -467,14 +472,14 @@
 # Fix static compilation with MSVC: https://bugs.exim.org/show_bug.cgi?id=1681
 # This code was taken from the CMake wiki, not from WebM.


-IF(MSVC AND PCRE2_STATIC)
-  MESSAGE(STATUS "** MSVC and PCRE2_STATIC: modifying compiler flags to use static runtime library")
+IF(MSVC AND PCRE2_STATIC_RUNTIME)
+  MESSAGE(STATUS "** MSVC and PCRE2_STATIC_RUNTIME: modifying compiler flags to use static runtime library")
   foreach(flag_var
           CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
           CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
     string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
   endforeach()
-ENDIF(MSVC AND PCRE2_STATIC)
+ENDIF(MSVC AND PCRE2_STATIC_RUNTIME)


# Build setup


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2016-06-22 19:23:33 UTC (rev 532)
+++ code/trunk/ChangeLog    2016-06-24 09:07:15 UTC (rev 533)
@@ -86,8 +86,10 @@
 "const" qualifiers in pcre2test and (b) defining snprintf as _snprintf for 
 older MSVC compilers.


-19. Applied Chris Wilson's patch (Bugzilla #1681) to CMakeLists.txt for MSVC
-static compilation.
+19. Applied Chris Wilson's patch (Bugzilla #1681) to CMakeLists.txt for MSVC
+static compilation. Subsequently applied Chris Wilson's second patch, putting
+the first patch under a new option instead of being unconditional when
+PCRE_STATIC is set.

20. Updated pcre2grep to set stdout as binary when run under Windows, so as not
to convert \r\n at the ends of reflected lines into \r\r\n. This required