[Bf-blender-cvs] [72f8a088805] master: CMake: use path_ensure_trailing_slash for fmacro-prefix-map

Campbell Barton noreply at git.blender.org
Wed Nov 4 06:02:00 CET 2020


Commit: 72f8a08880515ae8e31b5909cc3182c1cc9b6913
Author: Campbell Barton
Date:   Wed Nov 4 15:59:59 2020 +1100
Branches: master
https://developer.blender.org/rB72f8a08880515ae8e31b5909cc3182c1cc9b6913

CMake: use path_ensure_trailing_slash for fmacro-prefix-map

Use the native system slash so this can work on windows.

===================================================================

M	CMakeLists.txt

===================================================================

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



More information about the Bf-blender-cvs mailing list