diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2020-06-22 15:51:19 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2020-06-22 15:51:19 +0000 |
commit | f2b7cd8e64acbd7298eb0e315cdee043446e00f6 (patch) | |
tree | 9b72f0653a685b3f75240ac21b825fd25293a5db | |
parent | fab58b10fbeca00d294553d831ce09f5a62c6114 (diff) | |
download | pcre2-f2b7cd8e64acbd7298eb0e315cdee043446e00f6.tar.gz |
Fix Windows debug builds (Bugzilla #2600) using CMake.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1265 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | libpcre2-16.pc.in | 2 | ||||
-rw-r--r-- | libpcre2-32.pc.in | 2 | ||||
-rw-r--r-- | libpcre2-8.pc.in | 2 | ||||
-rw-r--r-- | libpcre2-posix.pc.in | 2 | ||||
-rw-r--r-- | pcre2-config.in | 8 |
8 files changed, 26 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 07652e9..ac80566 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,6 +495,12 @@ CONFIGURE_FILE(src/pcre2.h.in ${PROJECT_BINARY_DIR}/pcre2.h @ONLY) +# Make sure to not link debug libs +# against release libs and vice versa +IF(WIN32) + SET(CMAKE_DEBUG_POSTFIX "d") +ENDIF(WIN32) + # Generate pkg-config files SET(PACKAGE_VERSION "${PCRE2_MAJOR}.${PCRE2_MINOR}") @@ -503,6 +509,9 @@ SET(prefix ${CMAKE_INSTALL_PREFIX}) SET(exec_prefix "\${prefix}") SET(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") SET(includedir "\${prefix}/include") +IF(WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug)) + SET(LIB_POSTFIX ${CMAKE_DEBUG_POSTFIX}) +ENDIF() CONFIGURE_FILE(libpcre2-posix.pc.in libpcre2-posix.pc @ONLY) SET(pkg_config_files ${pkg_config_files} "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-posix.pc") @@ -642,11 +651,6 @@ IF(MSVC) ENDIF(MSVC) SET(CMAKE_INCLUDE_CURRENT_DIR 1) -# needed to make sure to not link debug libs -# against release libs and vice versa -IF(WIN32) - SET(CMAKE_DEBUG_POSTFIX "d") -ENDIF(WIN32) SET(targets) @@ -40,6 +40,10 @@ platforms.) 6. Added a (uint32_t) cast to prevent a compiler warning in pcre2_compile.c. +7. Applied a patch from Wolfgang Stöggl (Bugzilla #2600) to fix postfix for +debug Windows builds using CMake. This also updated configure so that it +generates *.pc files and pcre2-config with the same content, as in the past. + Version 10.35 09-May-2020 --------------------------- diff --git a/configure.ac b/configure.ac index 288446a..74abf26 100644 --- a/configure.ac +++ b/configure.ac @@ -1021,7 +1021,12 @@ if test "$pcre2_cc_cv_intel_cet_enabled" = yes; then fi AC_LANG_POP([C]) +# LIB_POSTFIX is used by CMakeLists.txt for Windows debug builds. +# Pass empty LIB_POSTFIX to *.pc files and pcre2-config here. +AC_SUBST(LIB_POSTFIX) + # Produce these files, in addition to config.h. + AC_CONFIG_FILES( Makefile libpcre2-8.pc diff --git a/libpcre2-16.pc.in b/libpcre2-16.pc.in index 978040d..bacb466 100644 --- a/libpcre2-16.pc.in +++ b/libpcre2-16.pc.in @@ -8,6 +8,6 @@ includedir=@includedir@ Name: libpcre2-16 Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lpcre2-16 +Libs: -L${libdir} -lpcre2-16@LIB_POSTFIX@ Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ diff --git a/libpcre2-32.pc.in b/libpcre2-32.pc.in index d8fb187..06241f0 100644 --- a/libpcre2-32.pc.in +++ b/libpcre2-32.pc.in @@ -8,6 +8,6 @@ includedir=@includedir@ Name: libpcre2-32 Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lpcre2-32 +Libs: -L${libdir} -lpcre2-32@LIB_POSTFIX@ Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ diff --git a/libpcre2-8.pc.in b/libpcre2-8.pc.in index 5c872d0..246bb9e 100644 --- a/libpcre2-8.pc.in +++ b/libpcre2-8.pc.in @@ -8,6 +8,6 @@ includedir=@includedir@ Name: libpcre2-8 Description: PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lpcre2-8 +Libs: -L${libdir} -lpcre2-8@LIB_POSTFIX@ Libs.private: @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ diff --git a/libpcre2-posix.pc.in b/libpcre2-posix.pc.in index 9641555..758c306 100644 --- a/libpcre2-posix.pc.in +++ b/libpcre2-posix.pc.in @@ -8,6 +8,6 @@ includedir=@includedir@ Name: libpcre2-posix Description: Posix compatible interface to libpcre2-8 Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lpcre2-posix +Libs: -L${libdir} -lpcre2-posix@LIB_POSTFIX@ Cflags: -I${includedir} @PCRE2_STATIC_CFLAG@ Requires.private: libpcre2-8 diff --git a/pcre2-config.in b/pcre2-config.in index 74271c0..bacea87 100644 --- a/pcre2-config.in +++ b/pcre2-config.in @@ -86,28 +86,28 @@ while test $# -gt 0; do ;; --libs-posix) if test @enable_pcre2_8@ = yes ; then - echo $libS$libR -lpcre2-posix -lpcre2-8 + echo $libS$libR -lpcre2-posix@LIB_POSTFIX@ -lpcre2-8@LIB_POSTFIX@ else echo "${usage}" 1>&2 fi ;; --libs8) if test @enable_pcre2_8@ = yes ; then - echo $libS$libR -lpcre2-8 + echo $libS$libR -lpcre2-8@LIB_POSTFIX@ else echo "${usage}" 1>&2 fi ;; --libs16) if test @enable_pcre2_16@ = yes ; then - echo $libS$libR -lpcre2-16 + echo $libS$libR -lpcre2-16@LIB_POSTFIX@ else echo "${usage}" 1>&2 fi ;; --libs32) if test @enable_pcre2_32@ = yes ; then - echo $libS$libR -lpcre2-32 + echo $libS$libR -lpcre2-32@LIB_POSTFIX@ else echo "${usage}" 1>&2 fi |