summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-06-24 09:01:23 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2016-06-24 09:01:23 +0000
commite4b4f4a81dd8c4086ea327c552a388d969a4280b (patch)
tree2a333e1d03ed4fd8dc894b72cd4c42d97144cee3
parent664df44c7eb62edbce95ab6dbdedcba7f07fed02 (diff)
downloadpcre-e4b4f4a81dd8c4086ea327c552a388d969a4280b.tar.gz
Add a new option for controlling static builds with MSVC. See Bugzilla #1681.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1659 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--CMakeLists.txt10
-rw-r--r--ChangeLog3
2 files changed, 10 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce6b167..42451ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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 @@ IF (MINGW)
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 @@ ENDIF(MSVC AND NOT PCRE_STATIC)
# 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 @@ IF(MSVC AND PCRE_STATIC)
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
diff --git a/ChangeLog b/ChangeLog
index 1588319..08b80a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@ Version 8.40 17-June-2016
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