direwolf/external/regex/CMakeLists.txt
Davide Gerhard 8cd1f87ef6
cmake: windows build fixes
works with cygwin and x86_64-w64-mingw32-gcc/x86_64-w64-mingw32-g++
from the package installer of cygwin.
To use that add the following lines to .bash_profile

export CC=x86_64-w64-mingw32-gcc
export CXX=x86_64-w64-mingw32-g++

you also need cmake from cygwin
2019-11-09 08:31:35 +01:00

25 lines
700 B
CMake

set(REGEX_LIBRARIES "" CACHE INTERNAL "")
if(WIN32 OR CYGWIN) # windows
set(REGEX_LIBRARIES regex CACHE INTERNAL "regex")
list(APPEND regex_SOURCES
# When building for Linux, we use regular expression
# functions supplied by the gnu C library.
# For the native WIN32 version, we need to use our own copy.
# These were copied from http://gnuwin32.sourceforge.net/packages/regex.htm
# Consider upgrading from https://www.gnu.org/software/libc/sources.html
${CUSTOM_REGEX_DIR}/regex.c
)
add_library(regex STATIC
${regex_SOURCES}
)
set_target_properties(regex
PROPERTIES COMPILE_FLAGS "-Dbool=int -Dtrue=1 -Dfalse=0 -DUSE_REGEX_STATIC"
)
endif()