File tree 2 files changed +7
-0
lines changed
2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ if(NOT build)
11
11
endif ()
12
12
13
13
find_package (benchmark REQUIRED)
14
+ get_target_property (BenchmarkBuildType benchmark::benchmark TYPE )
15
+
14
16
add_custom_target (run_benchmarks)
15
17
16
18
PCL_ADD_BENCHMARK(features_normal_3d FILES features/normal_3d.cpp
Original file line number Diff line number Diff line change @@ -441,6 +441,11 @@ function(PCL_ADD_BENCHMARK _name)
441
441
target_link_libraries (benchmark_${_name} benchmark::benchmark ${ARGS_LINK_WITH} )
442
442
set_target_properties (benchmark_${_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
443
443
444
+ # See https://github.com/google/benchmark/issues/1457
445
+ if (BenchmarkBuildType STREQUAL "STATIC_LIBRARY" AND benchmark_VERSION STREQUAL "1.7.0" )
446
+ target_compile_definitions (benchmark_${_name} PUBLIC -DBENCHMARK_STATIC_DEFINE)
447
+ endif ()
448
+
444
449
#Only applies to MSVC
445
450
if (MSVC )
446
451
#Requires CMAKE version 3.13.0
You can’t perform that action at this time.
0 commit comments