From d2cab81dd4fc3b151bf5442aaf21e039609b8b90 Mon Sep 17 00:00:00 2001 From: Alexios Lyrakis Date: Mon, 24 Aug 2026 13:20:09 +0100 Subject: [PATCH] Fix codegen configure_file writing config.h into source tree codegen/CMakeLists.txt generates config.h directly into the source tree (include/ck/config.h) instead of the build directory. This pollutes the source tree with a build artifact that lacks the #ifndef guards present in config.h.in, causing -Wmacro-redefined warnings when macros are also defined via -D flags on the command line. Write the generated config.h to CMAKE_CURRENT_BINARY_DIR instead, matching what the main CMakeLists.txt already does (line 530). --- codegen/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/CMakeLists.txt b/codegen/CMakeLists.txt index 69a6a71de21..b77d3c5656d 100644 --- a/codegen/CMakeLists.txt +++ b/codegen/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CK_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) -configure_file(${CK_ROOT}/include/ck/config.h.in ${CK_ROOT}/include/ck/config.h) +configure_file(${CK_ROOT}/include/ck/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/ck/config.h) find_package(ROCM) include(ROCMInstallTargets)