From f7a95f612e81b6ebe2b0d46d919456fde1f5960f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 9 Mar 2019 15:46:18 +0200 Subject: [PATCH] - extended RPATH for macOS with executable's directory Dynamic libraries placed in the directory with the main executable now can be loaded by dlopen() function This is required in order to enable Vulkan support without additional steps like SDK installed in the system --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78ca359651..48f1bc28c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1465,6 +1465,9 @@ if( APPLE ) LINK_FLAGS "-framework Cocoa -framework IOKit -framework OpenGL" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/zdoom-info.plist" ) + # Dymanic libraries like libvulkan.dylib or libMoltenVK.dylib will be loaded by dlopen() + # if placed in the directory with the main executable + set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rpath @executable_path" ) endif() if( WIN32 )