mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-04 02:06:22 -04:00
build: only build all benchmarks if explicitly requested
This commit is contained in:
parent
02b12418cc
commit
195c7e1461
@ -124,6 +124,9 @@ case "-$BUILD_TYPE-" in
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release"
|
||||
if [[ "-$BUILD_TYPE-" != *-minimal-* ]]; then
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_BENCHMARKS=1"
|
||||
if [[ "-$BUILD_TYPE-" != *-lto-* ]]; then
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_ALL_BENCHMARKS=1"
|
||||
fi
|
||||
fi
|
||||
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
||||
export CFLAGS="-ffunction-sections -fdata-sections -fvisibility=hidden -fmerge-all-constants"
|
||||
@ -135,6 +138,9 @@ case "-$BUILD_TYPE-" in
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=MinSizeRel"
|
||||
if [[ "-$BUILD_TYPE-" != *-minimal-* ]]; then
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_BENCHMARKS=1"
|
||||
if [[ "-$BUILD_TYPE-" != *-lto-* ]]; then
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_ALL_BENCHMARKS=1"
|
||||
fi
|
||||
fi
|
||||
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
||||
export CFLAGS="-ffunction-sections -fdata-sections -fvisibility=hidden -fmerge-all-constants"
|
||||
|
@ -31,6 +31,7 @@ option(WITH_TOOLS "build with tools" ON)
|
||||
option(WITH_FUSE_DRIVER "build with FUSE driver" ON)
|
||||
option(WITH_TESTS "build with tests" OFF)
|
||||
option(WITH_BENCHMARKS "build with benchmarks" OFF)
|
||||
option(WITH_ALL_BENCHMARKS "build with *all* benchmarks" OFF)
|
||||
option(WITH_FUZZ "build with fuzzing binaries" OFF)
|
||||
option(WITH_MAN_OPTION "build with --man option" ON)
|
||||
option(ENABLE_PERFMON "enable performance monitor in all tools" ON)
|
||||
@ -72,6 +73,10 @@ if(USE_JEMALLOC AND USE_MIMALLOC)
|
||||
message(FATAL_ERROR "USE_JEMALLOC and USE_MIMALLOC are mutually exclusive")
|
||||
endif()
|
||||
|
||||
if(WITH_ALL_BENCHMARKS)
|
||||
set(WITH_BENCHMARKS ON)
|
||||
endif()
|
||||
|
||||
# Libraries that we can fetch on demand if necessary
|
||||
#
|
||||
# All of these libraries are header-only and not strictly required once
|
||||
@ -647,6 +652,12 @@ if(WITH_LIBDWARFS AND WITH_BENCHMARKS)
|
||||
target_link_libraries(dwarfs_benchmark PRIVATE dwarfs_reader dwarfs_writer)
|
||||
list(APPEND BENCHMARK_TARGETS dwarfs_benchmark)
|
||||
|
||||
add_executable(segmenter_benchmark test/segmenter_benchmark.cpp)
|
||||
target_link_libraries(segmenter_benchmark PRIVATE dwarfs_test_helpers benchmark::benchmark)
|
||||
target_link_libraries(segmenter_benchmark PRIVATE dwarfs_writer)
|
||||
list(APPEND BENCHMARK_TARGETS segmenter_benchmark)
|
||||
|
||||
if(WITH_ALL_BENCHMARKS)
|
||||
add_executable(multiversioning_benchmark test/multiversioning_benchmark.cpp)
|
||||
target_link_libraries(multiversioning_benchmark PRIVATE benchmark::benchmark)
|
||||
target_link_libraries(multiversioning_benchmark PRIVATE dwarfs_writer)
|
||||
@ -664,11 +675,7 @@ if(WITH_LIBDWARFS AND WITH_BENCHMARKS)
|
||||
target_link_libraries(nilsimsa_benchmark PRIVATE benchmark::benchmark)
|
||||
target_link_libraries(nilsimsa_benchmark PRIVATE dwarfs_writer)
|
||||
list(APPEND BENCHMARK_TARGETS nilsimsa_benchmark)
|
||||
|
||||
add_executable(segmenter_benchmark test/segmenter_benchmark.cpp)
|
||||
target_link_libraries(segmenter_benchmark PRIVATE dwarfs_test_helpers benchmark::benchmark)
|
||||
target_link_libraries(segmenter_benchmark PRIVATE dwarfs_writer)
|
||||
list(APPEND BENCHMARK_TARGETS segmenter_benchmark)
|
||||
endif()
|
||||
|
||||
list(APPEND BINARY_TARGETS ${BENCHMARK_TARGETS})
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user