diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 110bfa69..34f345d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,12 @@ jobs: os: [windows-2022] platform: [x86_64] configuration: [Release] + configure: + - {label: "full", opt: "" } + - {label: "wo lmdb", opt: "-DWITHOUT_LMDB=ON" } + - {label: "wo lua", opt: "-DWITHOUT_LUA=ON" } + - {label: "wo maxmind", opt: "-DWITHOUT_MAXMIND=ON" } + - {label: "wo curl", opt: "-DWITHOUT_CURL=ON" } steps: - uses: actions/checkout@v4 with: @@ -89,9 +95,9 @@ jobs: pip3 install conan --upgrade conan profile detect - uses: ammaraskar/msvc-problem-matcher@master - - name: Build ${{ matrix.configuration }} ${{ matrix.platform }} + - name: Build ${{ matrix.configuration }} ${{ matrix.platform }} ${{ matrix.configure.label }} shell: cmd - run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform }} + run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform }} NO_ASAN "${{ matrix.configure.opt }}" - name: Set up test environment working-directory: build\win32\build\${{ matrix.configuration }} env: diff --git a/build/win32/CMakeLists.txt b/build/win32/CMakeLists.txt index 9b52926c..20cba66c 100644 --- a/build/win32/CMakeLists.txt +++ b/build/win32/CMakeLists.txt @@ -1,8 +1,14 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.24) set(BASE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) -set(USE_ASAN OFF CACHE BOOL "Build with Address Sanitizer") +option(WITHOUT_LMDB "Include LMDB support" OFF) +option(WITHOUT_LUA "Include LUA support" OFF) +option(WITHOUT_LIBXML2 "Include LibXML2 support" OFF) +option(WITHOUT_MAXMIND "Include MaxMind support" OFF) +option(WITHOUT_CURL "Include CURL support" OFF) + +option(USE_ASAN "Build with Address Sanitizer" OFF) # common compiler settings @@ -55,14 +61,23 @@ set(PACKAGE_VERSION "${PROJECT_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_TARNAME "${PACKAGE_NAME}") -set(HAVE_GEOIP 0) # should always be zero, no conan package available -set(HAVE_LMDB 1) -set(HAVE_LUA 1) -set(HAVE_LIBXML2 1) -set(HAVE_MAXMIND 1) -set(HAVE_SSDEEP 0) # should always be zero, no conan package available set(HAVE_YAJL 1) # should always be one, mandatory dependency -set(HAVE_CURL 1) +set(HAVE_GEOIP 0) # should always be zero, no conan package available +set(HAVE_SSDEEP 0) # should always be zero, no conan package available + +macro(enable_feature flag option) + if(${option}) + set(${flag} 0) + else() + set(${flag} 1) + endif() +endmacro() + +enable_feature(HAVE_LMDB ${WITHOUT_LMDB}) +enable_feature(HAVE_LUA ${WITHOUT_LUA}) +enable_feature(HAVE_LIBXML2 ${WITHOUT_LIBXML2}) +enable_feature(HAVE_MAXMIND ${WITHOUT_MAXMIND}) +enable_feature(HAVE_CURL ${WITHOUT_CURL}) include(${CMAKE_CURRENT_LIST_DIR}/ConfigureChecks.cmake) diff --git a/vcbuild.bat b/vcbuild.bat index 0789c9f8..b24572ab 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -22,7 +22,7 @@ if "%3"=="USE_ASAN" ( cd build\win32 conan install . -s compiler.cppstd=17 %CI_ASAN% --output-folder=build --build=missing --settings=build_type=%build_type% --settings=arch=%arch% cd build -cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DUSE_ASAN=%ASAN_FLAG% +cmake --fresh .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DUSE_ASAN=%ASAN_FLAG% %4 %5 %6 %7 %8 %9 cmake --build . --config %build_type% popd