File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,33 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
1212include_directories (include )
1313include_directories (instrument-hooks/includes)
1414
15- # Add the library
15+ # Create separate instrument_hooks library with warning suppressions
16+ add_library (
17+ instrument_hooks
18+ instrument-hooks/dist/core.c
19+ )
20+
21+ # Suppress warnings for the instrument_hooks library
22+ target_compile_options (
23+ instrument_hooks
24+ PRIVATE
25+ -Wno-unused-variable
26+ -Wno-unused-parameter
27+ -Wno-unused-but-set-variable
28+ -Wno-type -limits
29+ )
30+
31+ # Add the main library
1632add_library (
1733 codspeed
1834 src/codspeed.cpp
1935 src/walltime.cpp
2036 src/uri.cpp
2137 src/workspace.cpp
22- instrument-hooks/dist/core.c
2338)
2439
25- # Suppress warnings only for instrument-hooks/dist/core.c
26- set_source_files_properties (
27- instrument-hooks/dist/core.c
28- PROPERTIES COMPILE_FLAGS "-Wno-unused-variable -Wno-unused-parameter"
29- )
40+ # Link instrument_hooks to codspeed
41+ target_link_libraries (codspeed PRIVATE instrument_hooks)
3042
3143# Version
3244add_compile_definitions (CODSPEED_VERSION="${CODSPEED_VERSION} " )
@@ -125,7 +137,7 @@ install(
125137)
126138
127139install (
128- TARGETS codspeed
140+ TARGETS codspeed instrument_hooks
129141 EXPORT codspeed-targets
130142 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
131143 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
9292set (pkg_config "${generated_dir} /${PROJECT_NAME} .pc" )
9393set (pkg_config_main "${generated_dir} /${PROJECT_NAME} _main.pc" )
9494# TODO: Find a way to not expose codspeed headers to downstream users
95- set (targets_to_export benchmark benchmark_main codspeed)
95+ set (targets_to_export benchmark benchmark_main codspeed instrument_hooks )
9696set (targets_export_name "${PROJECT_NAME} Targets" )
9797
9898set (namespace "${PROJECT_NAME} ::" )
You can’t perform that action at this time.
0 commit comments