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"
|
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release"
|
||||||
if [[ "-$BUILD_TYPE-" != *-minimal-* ]]; then
|
if [[ "-$BUILD_TYPE-" != *-minimal-* ]]; then
|
||||||
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_BENCHMARKS=1"
|
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_BENCHMARKS=1"
|
||||||
|
if [[ "-$BUILD_TYPE-" != *-lto-* ]]; then
|
||||||
|
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_ALL_BENCHMARKS=1"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
||||||
export CFLAGS="-ffunction-sections -fdata-sections -fvisibility=hidden -fmerge-all-constants"
|
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"
|
CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=MinSizeRel"
|
||||||
if [[ "-$BUILD_TYPE-" != *-minimal-* ]]; then
|
if [[ "-$BUILD_TYPE-" != *-minimal-* ]]; then
|
||||||
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_BENCHMARKS=1"
|
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_BENCHMARKS=1"
|
||||||
|
if [[ "-$BUILD_TYPE-" != *-lto-* ]]; then
|
||||||
|
CMAKE_ARGS="${CMAKE_ARGS} -DWITH_ALL_BENCHMARKS=1"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
||||||
export CFLAGS="-ffunction-sections -fdata-sections -fvisibility=hidden -fmerge-all-constants"
|
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_FUSE_DRIVER "build with FUSE driver" ON)
|
||||||
option(WITH_TESTS "build with tests" OFF)
|
option(WITH_TESTS "build with tests" OFF)
|
||||||
option(WITH_BENCHMARKS "build with benchmarks" 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_FUZZ "build with fuzzing binaries" OFF)
|
||||||
option(WITH_MAN_OPTION "build with --man option" ON)
|
option(WITH_MAN_OPTION "build with --man option" ON)
|
||||||
option(ENABLE_PERFMON "enable performance monitor in all tools" 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")
|
message(FATAL_ERROR "USE_JEMALLOC and USE_MIMALLOC are mutually exclusive")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_ALL_BENCHMARKS)
|
||||||
|
set(WITH_BENCHMARKS ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Libraries that we can fetch on demand if necessary
|
# Libraries that we can fetch on demand if necessary
|
||||||
#
|
#
|
||||||
# All of these libraries are header-only and not strictly required once
|
# All of these libraries are header-only and not strictly required once
|
||||||
@ -647,29 +652,31 @@ if(WITH_LIBDWARFS AND WITH_BENCHMARKS)
|
|||||||
target_link_libraries(dwarfs_benchmark PRIVATE dwarfs_reader dwarfs_writer)
|
target_link_libraries(dwarfs_benchmark PRIVATE dwarfs_reader dwarfs_writer)
|
||||||
list(APPEND BENCHMARK_TARGETS dwarfs_benchmark)
|
list(APPEND BENCHMARK_TARGETS dwarfs_benchmark)
|
||||||
|
|
||||||
add_executable(multiversioning_benchmark test/multiversioning_benchmark.cpp)
|
|
||||||
target_link_libraries(multiversioning_benchmark PRIVATE benchmark::benchmark)
|
|
||||||
target_link_libraries(multiversioning_benchmark PRIVATE dwarfs_writer)
|
|
||||||
list(APPEND BENCHMARK_TARGETS multiversioning_benchmark)
|
|
||||||
|
|
||||||
add_executable(converter_benchmark test/converter_benchmark.cpp)
|
|
||||||
target_link_libraries(converter_benchmark PRIVATE dwarfs_test_helpers benchmark::benchmark)
|
|
||||||
list(APPEND BENCHMARK_TARGETS converter_benchmark)
|
|
||||||
|
|
||||||
add_executable(sorted_array_map_benchmark test/sorted_array_map_benchmark.cpp)
|
|
||||||
target_link_libraries(sorted_array_map_benchmark PRIVATE benchmark::benchmark)
|
|
||||||
list(APPEND BENCHMARK_TARGETS sorted_array_map_benchmark)
|
|
||||||
|
|
||||||
add_executable(nilsimsa_benchmark test/nilsimsa_benchmark.cpp)
|
|
||||||
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)
|
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_test_helpers benchmark::benchmark)
|
||||||
target_link_libraries(segmenter_benchmark PRIVATE dwarfs_writer)
|
target_link_libraries(segmenter_benchmark PRIVATE dwarfs_writer)
|
||||||
list(APPEND BENCHMARK_TARGETS segmenter_benchmark)
|
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)
|
||||||
|
list(APPEND BENCHMARK_TARGETS multiversioning_benchmark)
|
||||||
|
|
||||||
|
add_executable(converter_benchmark test/converter_benchmark.cpp)
|
||||||
|
target_link_libraries(converter_benchmark PRIVATE dwarfs_test_helpers benchmark::benchmark)
|
||||||
|
list(APPEND BENCHMARK_TARGETS converter_benchmark)
|
||||||
|
|
||||||
|
add_executable(sorted_array_map_benchmark test/sorted_array_map_benchmark.cpp)
|
||||||
|
target_link_libraries(sorted_array_map_benchmark PRIVATE benchmark::benchmark)
|
||||||
|
list(APPEND BENCHMARK_TARGETS sorted_array_map_benchmark)
|
||||||
|
|
||||||
|
add_executable(nilsimsa_benchmark test/nilsimsa_benchmark.cpp)
|
||||||
|
target_link_libraries(nilsimsa_benchmark PRIVATE benchmark::benchmark)
|
||||||
|
target_link_libraries(nilsimsa_benchmark PRIVATE dwarfs_writer)
|
||||||
|
list(APPEND BENCHMARK_TARGETS nilsimsa_benchmark)
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND BINARY_TARGETS ${BENCHMARK_TARGETS})
|
list(APPEND BINARY_TARGETS ${BENCHMARK_TARGETS})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user