From 72f8a08880515ae8e31b5909cc3182c1cc9b6913 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 Nov 2020 15:59:59 +1100 Subject: CMake: use path_ensure_trailing_slash for fmacro-prefix-map Use the native system slash so this can work on windows. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8fe1a234cf..a55eeffb6ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 -- cgit v1.2.3