Skip to content

Commit

Permalink
Merge pull request #59345 from Algunenano/sccache_fix
Browse files Browse the repository at this point in the history
Fix sccache when building without coverage
  • Loading branch information
alexey-milovidov committed Jan 29, 2024
2 parents 7683b44 + b88d0a2 commit 69a1935
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
9 changes: 6 additions & 3 deletions cmake/sanitize.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ if (SANITIZE_COVERAGE)

# But the actual coverage will be enabled on per-library basis: for ClickHouse code, but not for 3rd-party.
set (COVERAGE_FLAGS "-fsanitize-coverage=trace-pc-guard,pc-table")
endif()

set (WITHOUT_COVERAGE_FLAGS "-fno-profile-instr-generate -fno-coverage-mapping -fno-sanitize-coverage=trace-pc-guard,pc-table")
set (WITHOUT_COVERAGE_FLAGS_LIST -fno-profile-instr-generate -fno-coverage-mapping -fno-sanitize-coverage=trace-pc-guard,pc-table)
set (WITHOUT_COVERAGE_FLAGS "-fno-profile-instr-generate -fno-coverage-mapping -fno-sanitize-coverage=trace-pc-guard,pc-table")
set (WITHOUT_COVERAGE_FLAGS_LIST -fno-profile-instr-generate -fno-coverage-mapping -fno-sanitize-coverage=trace-pc-guard,pc-table)
else()
set (WITHOUT_COVERAGE_FLAGS "")
set (WITHOUT_COVERAGE_FLAGS_LIST "")
endif()
14 changes: 8 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,14 @@ if (TARGET ch_contrib::gwp_asan)
endif()

# Otherwise it will slow down stack traces printing too much.
set_source_files_properties(
Common/Elf.cpp
Common/Dwarf.cpp
Common/SymbolIndex.cpp
Common/ThreadFuzzer.cpp
PROPERTIES COMPILE_FLAGS "-O2 ${WITHOUT_COVERAGE_FLAGS}")
if ("${CMAKE_BUILD_TYPE_UC}" STREQUAL "DEBUG")
set_source_files_properties(
Common/Elf.cpp
Common/Dwarf.cpp
Common/SymbolIndex.cpp
Common/ThreadFuzzer.cpp
PROPERTIES COMPILE_FLAGS "-O2 ${WITHOUT_COVERAGE_FLAGS}")
endif()

target_link_libraries (clickhouse_common_io
PRIVATE
Expand Down

0 comments on commit 69a1935

Please sign in to comment.