Skip to content

Commit 4e8ab86

Browse files
authored
Remove PCRE2_STATIC_RUNTIME (#753)
Since we have raised our minimum CMake version to 3.15, this updates the default value of the "CMP0091" backwards-compatibility policy, such that PCRE2_STATIC_RUNTIME is now broken (since 10.45 when cmake_minimum_required was increased). We can remove this flag, since the new built-in CMAKE_MSVC_RUNTIME_LIBRARY provides the same behaviour.
1 parent c8e66a0 commit 4e8ab86

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ jobs:
260260
submodules: true
261261

262262
- name: Configure
263-
run: cmake $CMAKE_FLAGS -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2GREP_SUPPORT_CALLOUT_FORK=OFF -DPCRE2_DEBUG=ON -DPCRE2_NEWLINE=ANYCRLF -DPCRE2_STATIC_PIC=ON -DPCRE2_STATIC_RUNTIME=ON -DPCRE2_SUPPORT_BSR_ANYCRLF=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="$CFLAGS_MSVC" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -B build -A Win32
263+
run: cmake $CMAKE_FLAGS -DPCRE2_SUPPORT_JIT=ON -DPCRE2_BUILD_PCRE2_16=ON -DPCRE2_BUILD_PCRE2_32=ON -DPCRE2GREP_SUPPORT_CALLOUT_FORK=OFF -DPCRE2_DEBUG=ON -DPCRE2_NEWLINE=ANYCRLF -DPCRE2_STATIC_PIC=ON -DPCRE2_SUPPORT_BSR_ANYCRLF=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="$CFLAGS_MSVC" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -B build -A Win32
264264

265265
- name: Build
266266
run: cmake --build build --config RelWithDebInfo

CMakeLists.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ if(MINGW)
421421
endif()
422422

423423
if(MSVC)
424-
option(PCRE2_STATIC_RUNTIME "ON=Compile against the static runtime (/MT)." OFF)
425424
option(INSTALL_MSVC_PDB "ON=Install .pdb files built by MSVC, if generated" OFF)
426425
endif()
427426

@@ -846,23 +845,6 @@ if(MSVC AND BUILD_SHARED_LIBS)
846845
endif()
847846
endif()
848847

849-
# Fix static compilation with MSVC: https://bugs.exim.org/show_bug.cgi?id=1681
850-
# This code was taken from the CMake wiki, not from WebM.
851-
852-
if(MSVC AND PCRE2_STATIC_RUNTIME)
853-
message(STATUS "** MSVC and PCRE2_STATIC_RUNTIME: modifying compiler flags to use static runtime library")
854-
foreach(
855-
flag_var
856-
CMAKE_C_FLAGS
857-
CMAKE_C_FLAGS_DEBUG
858-
CMAKE_C_FLAGS_RELEASE
859-
CMAKE_C_FLAGS_MINSIZEREL
860-
CMAKE_C_FLAGS_RELWITHDEBINFO
861-
)
862-
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
863-
endforeach()
864-
endif()
865-
866848
# Build setup
867849

868850
add_compile_definitions(HAVE_CONFIG_H)

0 commit comments

Comments
 (0)