From fc0c6adae095aaec01e5eaf6a79d780946629bc7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 17 Jan 2023 12:25:52 +0100 Subject: [PATCH] macOS: fixed Vulkan shader bundling/loading --- Makefile.in | 1 + src/utils/fs.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4f092530e..84dbaf91b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -654,6 +654,7 @@ $(GUI_BUNDLE)/Contents/libs: $(BUNDLE)/Contents/libs $(GUI_BUNDLE) echo quit | $(DYLIBBUNDLER) $(DYLIBBUNDLER_FLAGS) -of -p @executable_path/../libs/ -cd -b -x $(GUI_BUNDLE)/Contents/MacOS/uv-qt -d $(GUI_BUNDLE)/Contents/libs/; \ cp $(BUNDLE)/Contents/MacOS/* $(GUI_BUNDLE)/Contents/MacOS/ [ -d $(BUNDLE)/Contents/libs ] && cp $(BUNDLE)/Contents/libs/* $(GUI_BUNDLE)/Contents/libs + [ -d $(BUNDLE)/Contents/share ] && { mkdir -p $(GUI_BUNDLE)/Contents/share; cp -r $(BUNDLE)/Contents/share/* $(GUI_BUNDLE)/Contents/share; } cp -R $(BUNDLE)/Contents/Frameworks/* $(GUI_BUNDLE)/Contents/Frameworks # add Qt frameworks command -v macdeployqt && macdeployqt $(GUI_BUNDLE) -verbose=2 -executable=$(GUI_BUNDLE)/Contents/MacOS/uv -executable=$(GUI_BUNDLE)/Contents/MacOS/hd-rum-transcode diff --git a/src/utils/fs.cpp b/src/utils/fs.cpp index e6a00fba5..9acfd9ac7 100644 --- a/src/utils/fs.cpp +++ b/src/utils/fs.cpp @@ -125,8 +125,8 @@ const char *get_install_root(void) { if (!last_path_delim) { return exec_path; } - if (strcmp(last_path_delim + 1, "bin") == 0) { - *last_path_delim = '\0'; // remove "bin" suffix if there is (not in Windows builds) + if (strcmp(last_path_delim + 1, "bin") == 0 || strcmp(last_path_delim + 1, "MacOS") == 0) { + *last_path_delim = '\0'; // remove "bin" suffix if there is one (not in Windows builds) or MacOS in a bundle } return exec_path; }