From f9bec3d5e23566b7672d9f840d32e438bd13f859 Mon Sep 17 00:00:00 2001 From: xfangfang <2553041586@qq.com> Date: Sun, 10 Dec 2023 22:28:54 +0800 Subject: [PATCH] workflow: Fix macOS build error --- CMakeLists.txt | 6 +++++- scripts/build_mac.sh | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a08d1a9b..ab0f1a08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,10 +205,14 @@ if (PLATFORM_DESKTOP) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos.cmake) set(bundle_args1 "-nb") set(bundle_args2 "${MACOS_DYLIB_DIR}") + else () + # Use system provided dylib + set(bundle_args1 "-b") + set(bundle_args2 "system") endif () add_custom_target( ${PROJECT_NAME}.app - COMMAND "bash" "${CMAKE_BINARY_DIR}/../scripts/build_mac.sh" "${bundle_args1}" "${bundle_args2}" + COMMAND "bash" "${CMAKE_BINARY_DIR}/../scripts/build_mac.sh" "${bundle_args1}" "${bundle_args2}" "${APP_VERSION}" ) add_dependencies(${PROJECT_NAME}.app ${PROJECT_NAME}) elseif (UNIX AND INSTALL) diff --git a/scripts/build_mac.sh b/scripts/build_mac.sh index f4eced34..3d601594 100755 --- a/scripts/build_mac.sh +++ b/scripts/build_mac.sh @@ -25,10 +25,7 @@ mkdir -p "${APP_PATH}"/Contents/Resources cp ./scripts/mac/Info.plist "${APP_PATH}"/Contents/Info.plist -version_major=$(jq .version_major resources/i18n/en-US/version.json) -version_minor=$(jq .version_minor resources/i18n/en-US/version.json) -version_revision=$(jq .version_revision resources/i18n/en-US/version.json) -version=${version_major}.${version_minor}.${version_revision} +version=$3 git_tag=$(git rev-parse --short HEAD) /usr/bin/sed -i '' '35s/1.0/'"${version}"'/' "${APP_PATH}"/Contents/Info.plist