From 5e97fcf4ef499740fb384f2381eb71fb8df0d33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 1 Oct 2024 00:43:15 -0300 Subject: [PATCH] Try again. --- premake5.lua | 11 ++++++++--- projects/macos/ecode/build.app.sh | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/premake5.lua b/premake5.lua index c2a925824..91e8e6c81 100644 --- a/premake5.lua +++ b/premake5.lua @@ -560,9 +560,14 @@ end function set_apple_config() if is_xcode() or _OPTIONS["use-frameworks"] then - linkoptions { "-F /Library/Frameworks" } - buildoptions { "-F /Library/Frameworks" } - incdirs { "/Library/Frameworks/SDL2.framework/Headers" } + linkoptions { "-F /Library/Frameworks", "src/thirdparty" } + buildoptions { "-F /Library/Frameworks", "src/thirdparty" } + local sdl2local = _MAIN_SCRIPT_DIR .. "src/thirdparty/SDL2.framework"; + if os.isdir(sdl2local) then + incdirs { sdl2local .. "/Headers" } + else + incdirs { "/Library/Frameworks/SDL2.framework/Headers" } + end end if os.istarget("macosx") then defines { "EE_SDL2_FROM_ROOTPATH" } diff --git a/projects/macos/ecode/build.app.sh b/projects/macos/ecode/build.app.sh index 3398a356b..1fe2fcf46 100755 --- a/projects/macos/ecode/build.app.sh +++ b/projects/macos/ecode/build.app.sh @@ -21,13 +21,26 @@ for i in "$@"; do done SDL2_CONFIG=$(which sdl2-config) +CONFIG_NAME= + +if command -v premake4 &> /dev/null +then + CONFIG_NAME=release +elif command -v premake5 &> /dev/null +then + CONFIG_NAME=release_arm64 +else + echo "Neither premake5 nor premake4 is available. Please install one." + exit 1 +fi + rm -rf ../../../libs/macosx if [ -z $SDL2_CONFIG ]; then echo "Building using frameworks" -../make.sh config=release ecode || exit +../make.sh config=$CONFIG_NAME ecode || exit else echo "Building using sdl2-config" -../make_no_fw.sh config=release ecode || exit +../make_no_fw.sh config=$CONFIG_NAME ecode || exit fi rm -rf ./ecode.app