CMake: use path_ensure_trailing_slash for fmacro-prefix-map

Use the native system slash so this can work on windows.
This commit is contained in:
Campbell Barton 2020-11-04 15:59:59 +11:00
parent 43a2494058
commit 72f8a08880
1 changed files with 6 additions and 2 deletions

View File

@ -1678,10 +1678,14 @@ if(WITH_COMPILER_SHORT_FILE_MACRO)
endif()
endif()
if(WITH_COMPILER_SHORT_FILE_MACRO)
path_ensure_trailing_slash(_src_dir "${CMAKE_SOURCE_DIR}")
path_ensure_trailing_slash(_bin_dir "${CMAKE_BINARY_DIR}")
set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} \
-fmacro-prefix-map='${CMAKE_SOURCE_DIR}/'='' \
-fmacro-prefix-map='${CMAKE_BINARY_DIR}/'=''"
-fmacro-prefix-map=\"${_src_dir}\"=\"\" \
-fmacro-prefix-map=\"${_bin_dir}\"=\"\""
)
unset(_src_dir)
unset(_bin_dir)
endif()
else()
message_first_run(WARNING