Skip to content

Commit

Permalink
Try again.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpartanJ committed Oct 1, 2024
1 parent 247f9cb commit 5e97fcf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
11 changes: 8 additions & 3 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
17 changes: 15 additions & 2 deletions projects/macos/ecode/build.app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e97fcf

Please sign in to comment.