Skip to content

Commit

Permalink
Fix PCRE2_DEBUG for multi-configuration builds
Browse files Browse the repository at this point in the history
  • Loading branch information
NWilson committed Oct 30, 2024
1 parent 96f0653 commit f327ede
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ OPTION(PCRE2_BUILD_PCRE2_32 "Build 32 bit PCRE2 library" OFF)

OPTION(PCRE2_STATIC_PIC "Build the static library with the option position independent code enabled." OFF)

OPTION(PCRE2_DEBUG "Include debugging code" OFF)
set(PCRE2_DEBUG "IfDebugBuild" CACHE STRING "Include debugging code")
set_property(CACHE PCRE2_DEBUG PROPERTY STRINGS "IfDebugBuild" "ON" "OFF")

OPTION(PCRE2_DISABLE_PERCENT_ZT "Disable the use of %zu and %td (rarely needed)" OFF)

Expand Down Expand Up @@ -689,6 +690,12 @@ ENDIF(MSVC AND PCRE2_STATIC_RUNTIME)

ADD_DEFINITIONS(-DHAVE_CONFIG_H)

if(PCRE2_DEBUG STREQUAL "IfDebugBuild")
ADD_COMPILE_DEFINITIONS("$<$<CONFIG:Debug>:PCRE2_DEBUG>")
elseif(PCRE2_DEBUG)
ADD_COMPILE_DEFINITIONS("PCRE2_DEBUG")
endif()

IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
ENDIF(MSVC)
Expand Down
1 change: 0 additions & 1 deletion config-cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#cmakedefine SUPPORT_PCRE2_8 1
#cmakedefine SUPPORT_PCRE2_16 1
#cmakedefine SUPPORT_PCRE2_32 1
#cmakedefine PCRE2_DEBUG 1
#cmakedefine DISABLE_PERCENT_ZT 1

#cmakedefine SUPPORT_LIBBZ2 1
Expand Down

0 comments on commit f327ede

Please sign in to comment.