From: Shlomi Fish Date: Sat, 30 Apr 2022 09:40:20 +0000 (+0300) Subject: gh actions #1: win32 fix X-Git-Tag: fortune-mod-3.14.0~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=148caa172431ba5dac2c3d3fabee26e766786124;p=fortune-mod gh actions #1: win32 fix --- diff --git a/fortune-mod/CMakeLists.txt b/fortune-mod/CMakeLists.txt index ed8cbd9..2ea8bbc 100644 --- a/fortune-mod/CMakeLists.txt +++ b/fortune-mod/CMakeLists.txt @@ -95,6 +95,7 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) SET (WITH_TEST_SUITE CACHE BOOL "") SET (NO_OFFENSIVE CACHE BOOL "Exclude the offensive option.") +SET (USE_WIN32_REGEX_LIBS CACHE BOOL "") SET (LOCALDIR "${CMAKE_INSTALL_PREFIX}/local/share/games/fortunes" CACHE STRING "LOCALDIR fortunes dir") SET (LOCALODIR "${LOCALDIR}/off" CACHE STRING "offensive fortunes localdir") SET (COOKIEDIR "${CMAKE_INSTALL_PREFIX}/share/games/fortunes" CACHE STRING "cookie dir not under /usr/local") @@ -160,7 +161,10 @@ MACRO(my_exe exe c_file dir) endif() if (WIN32) # See https://stackoverflow.com/questions/15119639/how-to-link-winsock-in-cmake - list(APPEND _libs intl regex wsock32 ws2_32) + if (USE_WIN32_REGEX_LIBS) + list(APPEND _libs intl regex) + endif() + list(APPEND _libs wsock32 ws2_32) endif() TARGET_LINK_LIBRARIES("${exe}" ${_libs}) if (NOT ("${dir}" STREQUAL "null"))