set MACOSX_RPATH to true on Apple

This commit is contained in:
Martin Kroeker 2024-08-04 23:38:22 +02:00 committed by GitHub
parent 19f8a8d61c
commit a4845fa12d
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()
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 # 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) if (APPLE AND BUILD_SHARED_LIBS AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 20)
set (CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) set (CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)