[Bf-blender-cvs] [819a9622e9c] master: CMake: remove -fmacro-prefix-map from build-info

Campbell Barton noreply at git.blender.org
Wed Nov 4 08:42:47 CET 2020


Commit: 819a9622e9c2a20ac461275d9788e8e0d67c879f
Author: Campbell Barton
Date:   Wed Nov 4 18:38:49 2020 +1100
Branches: master
https://developer.blender.org/rB819a9622e9c2a20ac461275d9788e8e0d67c879f

CMake: remove -fmacro-prefix-map from build-info

Quotes caused build-info to fail,
remove these flags since they're not necessary.

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

M	CMakeLists.txt
M	source/creator/CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a55eeffb6ba..ce5feb1b385 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1680,10 +1680,10 @@ if(WITH_COMPILER_SHORT_FILE_MACRO)
     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=\"${_src_dir}\"=\"\" \
--fmacro-prefix-map=\"${_bin_dir}\"=\"\""
-      )
+      # Keep this variable so it can be stripped from build-info.
+      set(PLATFORM_CFLAGS_FMACRO_PREFIX_MAP
+        "-fmacro-prefix-map=\"${_src_dir}\"=\"\" -fmacro-prefix-map=\"${_bin_dir}\"=\"\"")
+      set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} ${PLATFORM_CFLAGS_FMACRO_PREFIX_MAP}")
       unset(_src_dir)
       unset(_bin_dir)
     endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 74c2797856d..95af663d53e 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -152,9 +152,23 @@ if(WITH_BUILDINFO)
   add_definitions(-DWITH_BUILDINFO)
   # --------------------------------------------------------------------------
   # These defines could all be moved into the header below
-  string(REPLACE " " "\ " BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
-  string(REPLACE " " "\ " BUILDINFO_CXXFLAGS "${CMAKE_CXX_FLAGS}")
-  string(REPLACE " " "\ " BUILDINFO_LINKFLAGS "${PLATFORM_LINKFLAGS}")
+
+  set(BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
+  set(BUILDINFO_CXXFLAGS "${CMAKE_CXX_FLAGS}")
+  set(BUILDINFO_LINKFLAGS "${PLATFORM_LINKFLAGS}")
+
+  if(WITH_COMPILER_SHORT_FILE_MACRO)
+    # Needed because currently including quotes isn't supported.
+    # Besides this it's not necessary to include path information
+    # about the system building Blender in the executable.
+    string(REPLACE "${PLATFORM_CFLAGS_FMACRO_PREFIX_MAP}" " " BUILDINFO_CFLAGS "${BUILDINFO_CFLAGS}")
+    string(REPLACE "${PLATFORM_CFLAGS_FMACRO_PREFIX_MAP}" " " BUILDINFO_CXXFLAGS "${BUILDINFO_CXXFLAGS}")
+  endif()
+
+  string(REPLACE " " "\ " BUILDINFO_CFLAGS "${BUILDINFO_CFLAGS}")
+  string(REPLACE " " "\ " BUILDINFO_CXXFLAGS "${BUILDINFO_CXXFLAGS}")
+  string(REPLACE " " "\ " BUILDINFO_LINKFLAGS "${BUILDINFO_LINKFLAGS}")
+
   add_definitions(
     # # define in header now, else these get out of date on rebuilds.
     # -DBUILD_DATE="${BUILD_DATE}"



More information about the Bf-blender-cvs mailing list