diff --git a/cmake/install_sdk.cmake b/cmake/install_sdk.cmake index a705fe81..23d6c995 100644 --- a/cmake/install_sdk.cmake +++ b/cmake/install_sdk.cmake @@ -67,7 +67,10 @@ if(BUILD_PLATFORM STREQUAL "macosx") ") install(SCRIPT "${CMAKE_SOURCE_DIR}/cmake/macosx_bundle_vulkan.cmake") set_target_properties(${EVENGINE_NATIVE_TARGET} PROPERTIES - INSTALL_RPATH "@loader_path/../lib;@loader_path" + # SDK layout is bin/eve + lib/ (-> ../lib). `eve package` copies the + # lib/ tree next to eve as /lib (-> @loader_path/lib). Keep both + # so the same binary runs from the SDK and from a packaged game. + INSTALL_RPATH "@loader_path/../lib;@loader_path/lib;@loader_path" ) endif() diff --git a/platform/macosx/macosx.mm b/platform/macosx/macosx.mm index e6191593..ea1f0b6d 100644 --- a/platform/macosx/macosx.mm +++ b/platform/macosx/macosx.mm @@ -72,10 +72,11 @@ std::string bootstrapBundledVulkan() { const std::string exeDir = exe.substr(0, slash); // Packaged EVEngine distributions ship the loader + MoltenVK next to the - // executable: ../lib in the flat SDK layout (dist/eve-sdk/macosx), or + // executable: ../lib in the flat SDK layout (dist/eve-sdk/macosx), lib in + // a packaged game (eve package copies the SDK lib/ tree to /lib), or // ../Frameworks inside an .app bundle. const std::string dir = [&]() -> std::string { - for (const char *rel : {"../lib", "../Frameworks"}) { + for (const char *rel : {"../lib", "lib", "../Frameworks"}) { const std::string candidate = exeDir + "/" + rel; if (::access((candidate + "/libvulkan.1.dylib").c_str(), R_OK) == 0) return candidate;