diff options
Diffstat (limited to 'CMakeModules')
-rw-r--r-- | CMakeModules/FindPCRE2.cmake | 30 | ||||
-rw-r--r-- | CMakeModules/UseCompat.cmake | 7 |
2 files changed, 19 insertions, 18 deletions
diff --git a/CMakeModules/FindPCRE2.cmake b/CMakeModules/FindPCRE2.cmake index 19af7b7..a05d998 100644 --- a/CMakeModules/FindPCRE2.cmake +++ b/CMakeModules/FindPCRE2.cmake @@ -22,19 +22,23 @@ else() ${CMAKE_INSTALL_PREFIX}/include) # Look for the library. - find_library(PCRE2_LIBRARY - NAMES - libpcre2.a - pcre2-8 - PATHS - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /opt/local/lib - /sw/lib - ${CMAKE_LIBRARY_PATH} - ${CMAKE_INSTALL_PREFIX}/lib) + if (WIN32 AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + # For the Debug build, the pcre2 library is called pcre2-8d. The Release build should be pcre2-8. + find_library(PCRE2_LIBRARY pcre2-8d) + else() + find_library(PCRE2_LIBRARY + NAMES + pcre2-8 + PATHS + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + /opt/local/lib + /sw/lib + ${CMAKE_LIBRARY_PATH} + ${CMAKE_INSTALL_PREFIX}/lib) + endif() if(PCRE2_INCLUDE_DIR AND PCRE2_LIBRARY) # learn pcre2 version diff --git a/CMakeModules/UseCompat.cmake b/CMakeModules/UseCompat.cmake index c1befd7..ef3df89 100644 --- a/CMakeModules/UseCompat.cmake +++ b/CMakeModules/UseCompat.cmake @@ -27,6 +27,7 @@ macro(USE_COMPAT) set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200809L) list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__BSD_VISIBLE=1) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_DEFAULT_SOURCE) set(CMAKE_REQUIRED_LIBRARIES pthread) check_symbol_exists(vdprintf "stdio.h;stdarg.h" HAVE_VDPRINTF) @@ -47,16 +48,12 @@ macro(USE_COMPAT) check_include_file("stdatomic.h" HAVE_STDATOMIC) - include(CheckStructHasMember) - check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF) - check_symbol_exists(timezone time.h HAVE_TIME_H_TIMEZONE) - check_symbol_exists(realpath "stdlib.h" HAVE_REALPATH) check_symbol_exists(localtime_r "time.h" HAVE_LOCALTIME_R) check_symbol_exists(gmtime_r "time.h" HAVE_GMTIME_R) + check_function_exists(timegm HAVE_TIMEGM) check_symbol_exists(strptime "time.h" HAVE_STRPTIME) check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP) - check_symbol_exists(dirname "libgen.h" HAVE_DIRNAME) check_symbol_exists(setenv "stdlib.h" HAVE_SETENV) unset(CMAKE_REQUIRED_DEFINITIONS) |