Skip to content

Commit 05c8a74

Browse files
lvaroquiclaude
andcommitted
build: keep CODSPEED_COMPILE_DIR out of the installed package
The installed `benchmarkTargets.cmake` stored the compile directory of the build that compiled codspeed: an absolute path with Ninja, or a generator expression that is only right for Makefile consumers. A project using the installed package now gets no compile directory, so its URIs are computed as before this change. Refs COD-4223 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b20ac28 commit 05c8a74

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎core/CMakeLists.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,16 @@ message(STATUS "Using codspeed root directory: ${CODSPEED_ROOT_DIR}")
172172
# such as ccache with `base_dir`, make `__FILE__` relative to that directory.
173173
# Ninja runs every compiler in the top build directory; Makefiles run it in
174174
# the build directory of the target that owns the file.
175+
# The installed package doesn't get it: this directory belongs to the build
176+
# that compiles codspeed, not to the project that uses the package.
175177
if(CMAKE_GENERATOR MATCHES "Ninja")
176178
set(CODSPEED_COMPILE_DIR "${CMAKE_BINARY_DIR}")
177179
else()
178180
set(CODSPEED_COMPILE_DIR "$<TARGET_PROPERTY:BINARY_DIR>")
179181
endif()
180182
target_compile_definitions(
181183
codspeed
182-
INTERFACE -DCODSPEED_COMPILE_DIR="${CODSPEED_COMPILE_DIR}"
184+
INTERFACE $<BUILD_INTERFACE:CODSPEED_COMPILE_DIR="${CODSPEED_COMPILE_DIR}">
183185
)
184186

185187
set(CODSPEED_MODE_ALLOWED_VALUES

0 commit comments

Comments
 (0)