From 6d52a8e8b076df69831965fc1a10c9e79e8fcf5a Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:43:32 +0800 Subject: [PATCH] fix kForever --- CMakeLists.txt | 13 ++++++++----- src/log/log.cc | 1 + src/synchronization/event.cc | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 031542f..34c7d72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,8 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_EXTENSIONS OFF) +option(SLED_BUILD_BENCHMARK "Build benchmark" OFF) + set(BUILD_STATIC ON) set(BUILD_RTTR_DYNAMIC OFF) set(BUILD_UNIT_TESTS OFF) @@ -52,9 +54,10 @@ target_include_directories( target_link_libraries(sled PUBLIC rpc_core fmt) -find_package(benchmark REQUIRED) +if(SLED_BUILD_BENCHMARK) + find_package(benchmark REQUIRED) -add_executable(sled_benchmark -benchmark/strings/base64_benchmark.cc -) -target_link_libraries(sled_benchmark PRIVATE sled benchmark::benchmark benchmark::benchmark_main) + add_executable(sled_benchmark benchmark/strings/base64_benchmark.cc) + target_link_libraries(sled_benchmark PRIVATE sled benchmark::benchmark + benchmark::benchmark_main) +endif(SLED_BUILD_BENCHMARK) diff --git a/src/log/log.cc b/src/log/log.cc index c9bae1f..638c398 100644 --- a/src/log/log.cc +++ b/src/log/log.cc @@ -1,5 +1,6 @@ #include "sled/log/log.h" #include "sled/time_utils.h" +#include #include #include #include diff --git a/src/synchronization/event.cc b/src/synchronization/event.cc index 5b160cc..dc1aacf 100644 --- a/src/synchronization/event.cc +++ b/src/synchronization/event.cc @@ -1,7 +1,7 @@ #include "sled/synchronization/event.h" namespace sled { -constexpr TimeDelta Event::kForever; +// constexpr TimeDelta Event::kForever; Event::Event() : Event(false, false) {}