Skip to content

Commit

Permalink
fix: cmake optional compiler-rt
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasrim committed Jan 15, 2025
1 parent e880aed commit 5152a88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,25 @@ option(DF_USE_SSL "Provide support for SSL connections" ON)

find_package(OpenSSL)

SET(SANITIZERS OFF)

option(WITH_ASAN "Enable -fsanitize=address" OFF)
if (SUPPORT_ASAN AND WITH_ASAN)
message(STATUS "address sanitizer enabled")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
set(SANITIZERS ON)
endif()

option(WITH_USAN "Enable -fsanitize=undefined" OFF)
if (SUPPORT_USAN AND WITH_USAN)
message(STATUS "ub sanitizer enabled")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined")
set(SANITIZERS ON)
endif()

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -rtlib=compiler-rt")
if(SANITIZERS)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -rtlib=compiler-rt")
endif()

include(third_party)
include(internal)
Expand Down
3 changes: 2 additions & 1 deletion src/server/zset_family.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class ZSetFamily {
using MScoreResponse = std::vector<std::optional<double>>;

struct Bound {
double val;
Bound() = default;
double val = 0;
bool is_open = false;
};

Expand Down

0 comments on commit 5152a88

Please sign in to comment.