From bca5c19ec0e7841da4ddb46b445f254009c54836 Mon Sep 17 00:00:00 2001 From: Grzegorz Nosek Date: Tue, 4 Apr 2023 23:07:33 +0200 Subject: [PATCH] fix(build): don't write to source directory during build Signed-off-by: Grzegorz Nosek --- driver/bpf/CMakeLists.txt | 3 ++- driver/modern_bpf/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/driver/bpf/CMakeLists.txt b/driver/bpf/CMakeLists.txt index bdceaeab82a..1f15d8a1ddc 100644 --- a/driver/bpf/CMakeLists.txt +++ b/driver/bpf/CMakeLists.txt @@ -5,7 +5,7 @@ # MIT.txt or GPL.txt for full copies of the license. # -configure_file(../driver_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/../driver_config.h) +configure_file(../driver_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/driver_config.h) option(BUILD_BPF "Build the BPF driver on Linux" OFF) @@ -28,6 +28,7 @@ endif() install(FILES bpf_helpers.h builtins.h + driver_config.h filler_helpers.h fillers.h Makefile diff --git a/driver/modern_bpf/CMakeLists.txt b/driver/modern_bpf/CMakeLists.txt index 99b3090a360..64aa1a861cf 100644 --- a/driver/modern_bpf/CMakeLists.txt +++ b/driver/modern_bpf/CMakeLists.txt @@ -37,7 +37,7 @@ if(RESULT STREQUAL NOTFOUND) message(FATAL_ERROR "${MODERN_BPF_LOG_PREFIX} problem with compute_versions.cmake in ${CMAKE_MODULE_PATH}") endif() compute_versions(../API_VERSION ../SCHEMA_VERSION) -configure_file(../driver_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/../driver_config.h) +configure_file(../driver_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/driver/driver_config.h) ######################## # Check clang version. @@ -200,6 +200,7 @@ list(APPEND CLANG_FLAGS -I${LIBBPF_INCLUDE} -I${MODERN_PROBE_INCLUDE} -I${PPM_INCLUDE} + -I${CMAKE_CURRENT_BINARY_DIR} -isystem )