File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,34 @@ 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-maybe-uninitialized
26+ -Wno-unused-variable
27+ -Wno-unused-parameter
28+ -Wno-unused-but-set-variable
29+ -Wno-type -limits
30+ )
31+
32+ # Add the main library
1633add_library (
1734 codspeed
1835 src/codspeed.cpp
1936 src/walltime.cpp
2037 src/uri.cpp
2138 src/workspace.cpp
22- instrument-hooks/dist/core.c
2339)
2440
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- )
41+ # Link instrument_hooks to codspeed
42+ target_link_libraries (codspeed PRIVATE instrument_hooks)
3043
3144# Version
3245add_compile_definitions (CODSPEED_VERSION="${CODSPEED_VERSION} " )
@@ -125,7 +138,7 @@ install(
125138)
126139
127140install (
128- TARGETS codspeed
141+ TARGETS codspeed instrument_hooks
129142 EXPORT codspeed-targets
130143 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
131144 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