Revision: 1659
http://vcs.pcre.org/viewvc?view=rev&revision=1659
Author: ph10
Date: 2016-06-24 10:01:23 +0100 (Fri, 24 Jun 2016)
Log Message:
-----------
Add a new option for controlling static builds with MSVC. See Bugzilla #1681.
Modified Paths:
--------------
code/trunk/CMakeLists.txt
code/trunk/ChangeLog
Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt 2016-06-17 17:28:14 UTC (rev 1658)
+++ code/trunk/CMakeLists.txt 2016-06-24 09:01:23 UTC (rev 1659)
@@ -66,6 +66,7 @@
# 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".")
# 2013-11-05 PH added support for PARENS_NEST_LIMIT
# 2016-03-01 PH applied Chris Wilson's patch for MSVC static build
+# 2016-06-24 PH applied Chris Wilson's revised patch (adds a separate option)
PROJECT(PCRE C CXX)
@@ -190,6 +191,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)
@@ -573,8 +577,8 @@
# 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 PCRE_STATIC)
- MESSAGE(STATUS "** MSVC and PCRE_STATIC: modifying compiler flags to use static runtime library")
+IF(MSVC AND PCRE_STATIC_RUNTIME)
+ MESSAGE(STATUS "** MSVC and PCRE_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
@@ -582,7 +586,7 @@
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endforeach()
-ENDIF(MSVC AND PCRE_STATIC)
+ENDIF(MSVC AND PCRE_STATIC_RUNTIME)
SET(PCRECPP_HEADERS
pcrecpp.h
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2016-06-17 17:28:14 UTC (rev 1658)
+++ code/trunk/ChangeLog 2016-06-24 09:01:23 UTC (rev 1659)
@@ -9,6 +9,9 @@
1. Using -o with -M in pcregrep could cause unnecessary repeated output when
the match extended over a line boundary.
+
+2. Applied Chris Wilson's second patch (Bugzilla #1681) to CMakeLists.txt for
+ MSVC static compilation, putting the first patch under a new option.
Version 8.39 14-June-2016