Skip to content

Commit

Permalink
Change __FILE__ to only show the path relative to the project folder …
Browse files Browse the repository at this point in the history
…(patcher)
  • Loading branch information
pionere committed Nov 26, 2023
1 parent 084f7ac commit ca10f96
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit ca10f96

Please sign in to comment.