diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bced901..a3870cb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,13 @@ option(SPM_USE_EXTERNAL_ABSL "Use external protobuf" OFF) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) +if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10.0) OR + (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)) + string(APPEND CMAKE_CXX_FLAGS " -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=''") +endif() + if (UNIX) include(GNUInstallDirs) set(prefix ${CMAKE_INSTALL_PREFIX})