From ca10f96ab4c70dea5a782d9ee568e2cd95dcf1a3 Mon Sep 17 00:00:00 2001 From: pionere Date: Sun, 26 Nov 2023 12:07:19 +0100 Subject: [PATCH] Change __FILE__ to only show the path relative to the project folder (patcher) --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5eaade650a..93e1985dbdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1073,8 +1073,15 @@ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8)) target_compile_options(${BIN_TARGET} PUBLIC "-fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=") + if(USE_PATCH) + target_compile_options(${DEVIL_PATCHER} PUBLIC "-fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=") + endif() else() get_target_property(devilutionx_SRCS ${BIN_TARGET} SOURCES) + if(USE_PATCH) + get_target_property(devil_patcher_SRCS ${DEVIL_PATCHER} SOURCES) + list (APPEND devilutionx_SRCS ${devil_patcher_SRCS}) + endif() foreach(SOURCE_FILE ${devilutionx_SRCS}) set_source_files_properties(${SOURCE_FILE} PROPERTIES COMPILE_DEFINITIONS __FILE__="${SOURCE_FILE}"