Skip to content

Commit d8711f5

Browse files
authored
Merge pull request #664 from danieldk/remove-build-path
Strip build directory prefix in the __FILE__ macro
2 parents cbfc6b3 + cab2e3c commit d8711f5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ option(SPM_USE_EXTERNAL_ABSL "Use external protobuf" OFF)
3131
set(CMAKE_CXX_STANDARD 11)
3232
set(CMAKE_CXX_STANDARD_REQUIRED ON)
3333

34+
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
35+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10.0) OR
36+
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
37+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0))
38+
string(APPEND CMAKE_CXX_FLAGS " -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=''")
39+
endif()
40+
3441
if (UNIX)
3542
include(GNUInstallDirs)
3643
set(prefix ${CMAKE_INSTALL_PREFIX})

0 commit comments

Comments
 (0)