Fix debugging and profiling on macOS

pull/998/head
Koen Schmeets 2021-02-08 01:07:53 +01:00 committed by phkahler
parent 8105699d5e
commit 2a56ba661e
1 changed files with 7 additions and 5 deletions

View File

@ -72,11 +72,13 @@ endif()
# common compiler flags # common compiler flags
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
set(FILE_PREFIX_MAP "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.") if (NOT APPLE)
check_cxx_compiler_flag("${FILE_PREFIX_MAP}" HAS_FILE_PREFIX_MAP) set(FILE_PREFIX_MAP "-ffile-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.")
if(HAS_FILE_PREFIX_MAP) check_cxx_compiler_flag("${FILE_PREFIX_MAP}" HAS_FILE_PREFIX_MAP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FILE_PREFIX_MAP}") if(HAS_FILE_PREFIX_MAP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FILE_PREFIX_MAP}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FILE_PREFIX_MAP}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FILE_PREFIX_MAP}")
endif()
endif() endif()
if(MINGW) if(MINGW)