Skip to content

Commit

Permalink
Extract a method or a function.
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Aug 7, 2023
1 parent 51857be commit 294ea23
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fortune-mod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ ENDIF()

CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)

MACRO(_fortune__enable_regex)
ADD_DEFINITIONS("-DHAVE_REGEX_H")
ADD_DEFINITIONS("-DPOSIX_REGEX")
ENDMACRO()

IF (USE_PCRE)
FIND_PACKAGE (PkgConfig REQUIRED)
pkg_check_modules(PCRE2 REQUIRED libpcre2-posix)
Expand All @@ -300,11 +305,9 @@ IF (USE_PCRE)
add_definitions (${PCRE2_CFLAGS_OTHER})
TARGET_LINK_LIBRARIES("fortune" ${PCRE2_LIBRARIES})
ADD_DEFINITIONS("-DHAVE_PCRE2")
ADD_DEFINITIONS("-DHAVE_REGEX_H")
ADD_DEFINITIONS("-DPOSIX_REGEX")
_fortune__enable_regex()
ELSEIF (HAVE_REGEX_H)
ADD_DEFINITIONS("-DHAVE_REGEX_H")
ADD_DEFINITIONS("-DPOSIX_REGEX")
_fortune__enable_regex()
ENDIF()

ADD_DEFINITIONS("-DHAVE_STDBOOL")
Expand Down

0 comments on commit 294ea23

Please sign in to comment.