Merge pull request #4840 from martin-frbg/issue4823

set MACOSX_RPATH to true on Apple
This commit is contained in:
Martin Kroeker 2024-08-05 15:35:25 +02:00 committed by GitHub
commit 14a8a9a43c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -256,6 +256,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "AIX|Android|Linux|FreeBSD|OpenBSD|NetBSD|Drago
endif()
endif()
if (APPLE AND BUILD_SHARED_LIBS)
set(CMAKE_MACOSX_RPATH ON)
endif()
# Seems that this hack doesn't required since macOS 11 Big Sur
if (APPLE AND BUILD_SHARED_LIBS AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 20)
set (CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)