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)
12
12
include_directories (include )
13
13
include_directories (instrument-hooks/includes )
14
14
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
16
32
add_library (
17
33
codspeed
18
34
src/codspeed.cpp
19
35
src/walltime.cpp
20
36
src/uri.cpp
21
37
src/workspace.cpp
22
- instrument-hooks/dist/core.c
23
38
)
24
39
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 )
30
42
31
43
# Version
32
44
add_compile_definitions (CODSPEED_VERSION= "${CODSPEED_VERSION} " )
@@ -125,7 +137,7 @@ install(
125
137
)
126
138
127
139
install (
128
- TARGETS codspeed
140
+ TARGETS codspeed instrument_hooks
129
141
EXPORT codspeed-targets
130
142
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
131
143
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")
92
92
set (pkg_config "${generated_dir} /${PROJECT_NAME} .pc" )
93
93
set (pkg_config_main "${generated_dir} /${PROJECT_NAME} _main.pc" )
94
94
# 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 )
96
96
set (targets_export_name "${PROJECT_NAME} Targets" )
97
97
98
98
set (namespace "${PROJECT_NAME} ::" )
You can’t perform that action at this time.
0 commit comments