1
0
Fork 0
mirror of https://github.com/cosmo-sims/monofonIC.git synced 2024-09-16 13:33:45 +02:00

added additional linker options for newer versions of MacOS to re-enable C++ exceptions and prevent possible linker problems

This commit is contained in:
Oliver Hahn 2024-03-19 17:38:46 +01:00
parent f8af7d1469
commit 9df2d90e47

View file

@ -310,3 +310,13 @@ if(ENABLE_GENERICIO)
target_link_libraries(${PRGNAME} PRIVATE genericio::genericio_mpi)
target_compile_definitions(${PRGNAME} PRIVATE "ENABLE_GENERICIO")
endif()
########################################################################################################################
# CPU specifics
if(APPLE)
# prevent linking problems on recent MacOS, enable exceptions (disabled otherwise)
target_link_options(${PRGNAME} PRIVATE "-fexceptions" "-Wl,-no_warn_duplicate_libraries,-ld_classic" )
set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} -Wl,-keep_dwarf_unwind")
set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} -Wl,-keep_dwarf_unwind")
set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} -Wl,-keep_dwarf_unwind")
endif()