From 4e5ca6be6c52a70c2fb79ecd3eb2046cbf5fdac1 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Wed, 4 Mar 2026 20:47:34 +0100 Subject: [PATCH] fix nix build error --- CMakeLists.txt | 5 +++-- src/main.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ff816e..4062036 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,8 +68,9 @@ if(NOT DISABLE_TRACY) list(APPEND FLAGS TRACY) endif() -# Set this after fetching tracy to hide tracy's warnings -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wno-unused-parameter -Wunreachable-code") +# Set this after fetching tracy to hide tracy's warnings. +# We set -Wno-alloc-size-larger-than because it prevents BS::thread_pool from building with current gcc +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wno-unused-parameter -Wunreachable-code -Wno-alloc-size-larger-than") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O0") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ggdb -O3 -ffast-math -march=native") diff --git a/src/main.cpp b/src/main.cpp index 4fd3b10..981ff83 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,7 +38,7 @@ auto set_pool_thread_name(size_t idx) -> void BS::this_thread::set_os_thread_name(std::format("worker-{}", idx)); } -BS::thread_pool<> threads(std::thread::hardware_concurrency(), set_pool_thread_name); +BS::thread_pool<> threads(std::thread::hardware_concurrency() - 2, set_pool_thread_name); constexpr std::optional* const> thread_pool = &threads; #else constexpr std::optional* const> thread_pool = std::nullopt;