[Pcre-svn] [1265] code/trunk: Fix Windows debug builds (Bugz…

Páxina inicial
Borrar esta mensaxe
Autor: Subversion repository
Data:  
Para: pcre-svn
Asunto: [Pcre-svn] [1265] code/trunk: Fix Windows debug builds (Bugzilla #2600) using CMake.
Revision: 1265
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1265
Author:   ph10
Date:     2020-06-22 16:51:19 +0100 (Mon, 22 Jun 2020)
Log Message:
-----------
Fix Windows debug builds (Bugzilla #2600) using CMake.


Modified Paths:
--------------
    code/trunk/CMakeLists.txt
    code/trunk/ChangeLog
    code/trunk/configure.ac
    code/trunk/libpcre2-16.pc.in
    code/trunk/libpcre2-32.pc.in
    code/trunk/libpcre2-8.pc.in
    code/trunk/libpcre2-posix.pc.in
    code/trunk/pcre2-config.in


Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/CMakeLists.txt    2020-06-22 15:51:19 UTC (rev 1265)
@@ -495,6 +495,12 @@
                ${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(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 @@
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)


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/ChangeLog    2020-06-22 15:51:19 UTC (rev 1265)
@@ -40,7 +40,11 @@


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
---------------------------


Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/configure.ac    2020-06-22 15:51:19 UTC (rev 1265)
@@ -1021,7 +1021,12 @@
 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


Modified: code/trunk/libpcre2-16.pc.in
===================================================================
--- code/trunk/libpcre2-16.pc.in    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/libpcre2-16.pc.in    2020-06-22 15:51:19 UTC (rev 1265)
@@ -8,6 +8,6 @@
 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@


Modified: code/trunk/libpcre2-32.pc.in
===================================================================
--- code/trunk/libpcre2-32.pc.in    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/libpcre2-32.pc.in    2020-06-22 15:51:19 UTC (rev 1265)
@@ -8,6 +8,6 @@
 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@


Modified: code/trunk/libpcre2-8.pc.in
===================================================================
--- code/trunk/libpcre2-8.pc.in    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/libpcre2-8.pc.in    2020-06-22 15:51:19 UTC (rev 1265)
@@ -8,6 +8,6 @@
 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@


Modified: code/trunk/libpcre2-posix.pc.in
===================================================================
--- code/trunk/libpcre2-posix.pc.in    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/libpcre2-posix.pc.in    2020-06-22 15:51:19 UTC (rev 1265)
@@ -8,6 +8,6 @@
 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


Modified: code/trunk/pcre2-config.in
===================================================================
--- code/trunk/pcre2-config.in    2020-06-05 16:11:01 UTC (rev 1264)
+++ code/trunk/pcre2-config.in    2020-06-22 15:51:19 UTC (rev 1265)
@@ -86,7 +86,7 @@
       ;;
     --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
@@ -93,7 +93,7 @@
       ;;
     --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
@@ -100,7 +100,7 @@
       ;;
     --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
@@ -107,7 +107,7 @@
       ;;
     --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