From e488a604784f05fe0d53a9bb4cb74407c6c686c7 Mon Sep 17 00:00:00 2001 From: Vlad Gheorghiu Date: Thu, 23 Jan 2025 11:37:26 -0500 Subject: [PATCH] Added NOMINMAX Signed-off-by: Vlad Gheorghiu --- .github/workflows/cmake.yml | 26 +++++++++++----------- CMakeLists.txt | 1 + libs/third_party/easy/sat2/cardinality.hpp | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1d36fc9..8e48a01 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -26,19 +26,19 @@ jobs: .\vcpkg\bootstrap-vcpkg.bat .\vcpkg\vcpkg install pkgconf:x64-windows - - name: Install gmp - shell: bash - run: | - if [ "$RUNNER_OS" == "Windows" ]; then - ./vcpkg/vcpkg install gmp:x64-windows - elif [ "$RUNNER_OS" == "Linux" ]; then - sudo apt-get install -y libgmp-dev - elif [ "$RUNNER_OS" == "macOS" ]; then - brew install gmp - else - echo "$RUNNER_OS not supported" - exit 1 - fi + # - name: Install gmp + # shell: bash + # run: | + # if [ "$RUNNER_OS" == "Windows" ]; then + # ./vcpkg/vcpkg install gmp:x64-windows + # elif [ "$RUNNER_OS" == "Linux" ]; then + # sudo apt-get install -y libgmp-dev + # elif [ "$RUNNER_OS" == "macOS" ]; then + # brew install gmp + # else + # echo "$RUNNER_OS not supported" + # exit 1 + # fi - name: Configure staq shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index a45f04a..0b40143 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ endif() # Windows issues with Microsoft Visual Studio if(MSVC) + add_definitions(-DNOMINMAX) include_directories(SYSTEM libs/third_party/pthreadwin32) add_compile_options(/bigobj) add_compile_options(/utf-8) diff --git a/libs/third_party/easy/sat2/cardinality.hpp b/libs/third_party/easy/sat2/cardinality.hpp index 8c95911..53c6700 100644 --- a/libs/third_party/easy/sat2/cardinality.hpp +++ b/libs/third_party/easy/sat2/cardinality.hpp @@ -60,7 +60,7 @@ inline void create_totalizer_internal(std::vector>& dest, uint32_t rhs, std::vector const& av, std::vector const& bv) { /* i = 0 */ - uint32_t kmin = std::min(rhs, static_cast(bv.size())); + uint32_t kmin = std::min(rhs, uint32_t(bv.size())); for (auto j = 0; j < kmin; ++j) { dest.emplace_back(std::vector{-bv[j], ov[j]}); }