- 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
This commit is contained in:
alexey.lysiuk 2019-03-09 15:46:18 +02:00
parent 4ac82c18be
commit f7a95f612e

View file

@ -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 )