Skip to content

Commit

Permalink
Add windows support + ffmpeg build option
Browse files Browse the repository at this point in the history
  • Loading branch information
ManpreetXSingh committed Feb 4, 2024
1 parent ec0be72 commit 9217799
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
23 changes: 19 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ function compile_gdextension() {
git pull
popd

local scons_extra_args=""

echo "GDExtension compiling"
echo "Select target platform:"
echo "1. Linux"
echo "2. Windows (not-supported yet)"
echo "2. Windows (Msys2)"
echo "3. Mac (not-supported yet)"
read -p "> " platform
case $platform in
Expand All @@ -46,8 +48,7 @@ function compile_gdextension() {
;;
2)
platform=windows
#echo "Windows export not supported yet!"
#exit 1
scons_extra_args="use_mingw=yes"
;;
3)
platform=macos
Expand Down Expand Up @@ -75,10 +76,24 @@ function compile_gdextension() {
target=template_debug
;;
esac

echo "Enter amount of cores/thread for compiling:"
read -p "> " num_jobs

echo "Build FFmpeg? (y/N)"
read -p "> " ffmpeg
case $ffmpeg in
y)
pushd src/bin/gde_ffmpeg/
./build-ffmpeg.sh $platform $num_jobs || { echo "FFmpeg build failed"; exit 1; }
popd
;;
*)
;;
esac

pushd src/bin/gde_ffmpeg/
scons -j $num_jobs target=$target platform=$platform
scons -j $num_jobs target=$target platform=$platform $scons_extra_args
popd
}

Expand Down
3 changes: 2 additions & 1 deletion src/bin/gde_ffmpeg/build-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ git pull

config_extra_args=""
if [ "$platform" = "windows" ]; then
cross_prefix="/opt/bin/x86_64-w64-mingw32-"
export PATH="/opt/bin":$PATH
cross_prefix="x86_64-w64-mingw32-"
config_extra_args="--cross-prefix="$cross_prefix" --arch=x86_64 --target-os=mingw32"
fi

Expand Down

0 comments on commit 9217799

Please sign in to comment.