[Bf-blender-cvs] [f2c7b4a1c54] master: Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error.

Ankit Meel noreply at git.blender.org
Mon Nov 2 11:43:10 CET 2020


Commit: f2c7b4a1c54e27bc7df3f51871f8767c9f280f37
Author: Ankit Meel
Date:   Mon Nov 2 16:11:10 2020 +0530
Branches: master
https://developer.blender.org/rBf2c7b4a1c54e27bc7df3f51871f8767c9f280f37

Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error.

The issue was in `buildinfo.c`:
  char build_c[xx]flags[] = BUILD_C[XX]FLAGS;

Non-escaped double-quotes were terminating the string early, and
causing the compile error. So use single-quotes.

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

M	CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab69048e205..f8fe1a234cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -571,7 +571,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
 endif()
 
 if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
-  option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ relative to top level source and build directories." OFF)
+  option(WITH_COMPILER_SHORT_FILE_MACRO "Make paths in macros like __FILE__ relative to top level source and build directories." ON)
   mark_as_advanced(WITH_COMPILER_SHORT_FILE_MACRO)
 endif()
 
@@ -1679,8 +1679,8 @@ if(WITH_COMPILER_SHORT_FILE_MACRO)
     endif()
     if(WITH_COMPILER_SHORT_FILE_MACRO)
       set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} \
--fmacro-prefix-map=\"${CMAKE_SOURCE_DIR}/\"=\"\" \
--fmacro-prefix-map=\"${CMAKE_BINARY_DIR}/\"=\"\""
+-fmacro-prefix-map='${CMAKE_SOURCE_DIR}/'='' \
+-fmacro-prefix-map='${CMAKE_BINARY_DIR}/'=''"
       )
     endif()
   else()



More information about the Bf-blender-cvs mailing list