From c43242fdde825ee969f0e6289ed8fc671cc47b3b Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 7 Nov 2024 20:10:17 +0100 Subject: [PATCH] [cmake,buildflags] replace CMAKE_SOURCE_DIR and CMAKE_BUILD_DIR replace source and build directories with palceholders --- cmake/CFlagsToVar.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/CFlagsToVar.cmake b/cmake/CFlagsToVar.cmake index 67c899d47..b6b1af6bd 100644 --- a/cmake/CFlagsToVar.cmake +++ b/cmake/CFlagsToVar.cmake @@ -1,5 +1,8 @@ function(CFlagsToVar NAME) set(C_FLAGS ${CMAKE_C_FLAGS}) + string(REPLACE "${CMAKE_SOURCE_DIR}" "" C_FLAGS "${C_FLAGS}") + string(REPLACE "${CMAKE_BINARY_DIR}" "" C_FLAGS "${C_FLAGS}") + if (CMAKE_BUILD_TYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" CAPS_BUILD_TYPE) string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${CAPS_BUILD_TYPE}}")