diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c49842..a7fe98a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Configure CMake run: | - cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=ON -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address" + cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=20 -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=ON -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address" - name: Build run: | @@ -101,7 +101,7 @@ jobs: - name: Build for analysis run: | - cmake -B build -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 cmake --build build -j$(nproc) - name: Perform CodeQL Analysis diff --git a/CMakeLists.txt b/CMakeLists.txt index ffe54f5..f3535ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,29 +76,33 @@ endif() find_package(OpenSSL REQUIRED) find_package(nlohmann_json REQUIRED) -# Handle spdlog and fmt with fallback to FetchContent +# Handle fmt and spdlog with fallback to FetchContent include(FetchContent) -find_package(spdlog QUIET) -if(NOT spdlog_FOUND) - message(STATUS "spdlog not found, downloading...") - FetchContent_Declare( - spdlog - GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG v1.12.0) - FetchContent_MakeAvailable(spdlog) -endif() - find_package(fmt QUIET) if(NOT fmt_FOUND) message(STATUS "fmt not found, downloading...") FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git - GIT_TAG 10.1.1) + GIT_TAG 10.2.1) FetchContent_MakeAvailable(fmt) endif() +set(SPDLOG_FMT_EXTERNAL + ON + CACHE BOOL "Use external fmt in spdlog" FORCE) + +find_package(spdlog QUIET) +if(NOT spdlog_FOUND) + message(STATUS "spdlog not found, downloading...") + FetchContent_Declare( + spdlog + GIT_REPOSITORY https://github.com/gabime/spdlog.git + GIT_TAG v1.14.1) + FetchContent_MakeAvailable(spdlog) +endif() + # Create OpenSSL targets if they don't exist (for compatibility with older # CMake) if(OPENSSL_FOUND AND NOT TARGET OpenSSL::SSL)