diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 750612728..c47e02620 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,31 @@ jobs: run: | cd build make test + + win32: + runs-on: windows-latest + steps: + - run: git config --global core.autocrlf input + - uses: actions/checkout@v2 + - uses: msys2/setup-msys2@v2 + with: + pacboy: >- + toolchain:p + cmake:p + - name: Build + shell: msys2 {0} + run: | + mkdir build + cd build + export CFLAGS="-D__USE_MINGW_ANSI_STDIO=1" + # CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS doesn't work correctly in the + # presence of explicit dllexports for the gcc/binutils toolchain + export LDFLAGS="-Wl,--export-all-symbols" + cmake -DENABLE_STATIC=ON -DWITHOUT_COOKIEOPEN=ON .. + ninja + - name: Test + shell: msys2 {0} + run: | + cd build + export PATH="$(pwd)/src:$(pwd)/ext:${PATH}" + ninja test diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bbf30bac1..b07cd4e73 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -69,6 +69,9 @@ INSTALL (TARGETS libsolv LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DES IF (ENABLE_STATIC AND NOT DISABLE_SHARED) ADD_LIBRARY (libsolv_static STATIC ${libsolv_SRCS}) +IF (WIN32) + TARGET_COMPILE_DEFINITIONS(libsolv_static PUBLIC SOLV_STATIC_LIB) +ENDIF (WIN32) SET_TARGET_PROPERTIES(libsolv_static PROPERTIES OUTPUT_NAME "solv") SET_TARGET_PROPERTIES(libsolv_static PROPERTIES SOVERSION ${LIBSOLV_SOVERSION}) INSTALL (TARGETS libsolv_static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/win32/regex.h b/win32/regex.h index 06a10906b..534bde742 100644 --- a/win32/regex.h +++ b/win32/regex.h @@ -12,7 +12,7 @@ extern "C" { #define CHARCLASS_NAME_MAX 14 #define RE_DUP_MAX 255 -#include +#include typedef SSIZE_T regoff_t; // #include