]> granicus.if.org Git - fortune-mod/commitdiff
gh actions #1: win32 fix
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 30 Apr 2022 09:40:20 +0000 (12:40 +0300)
committerShlomi Fish <shlomif@shlomifish.org>
Sat, 30 Apr 2022 09:40:20 +0000 (12:40 +0300)
fortune-mod/CMakeLists.txt

index ed8cbd93f162c2a9613013e561a8908cddb2e927..2ea8bbcce798ec2adab790838b71096a2ea146e7 100644 (file)
@@ -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"))