mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-05 04:34:23 +02:00
Add support for Windows 64-bit
Tested on NixOS, Ubuntu and Arch Linux. Not yet able to compile for Windows 32-bit on NixOS or on Windows itself. Part of #5
This commit is contained in:
parent
fc60c366e6
commit
630e0104d5
10 changed files with 328 additions and 110 deletions
|
@ -1,37 +1,47 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
|
||||
# Get the absolute path to the directory this script is in.
|
||||
NATIVE_DIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
|
||||
|
||||
# Run script inside a nix shell if it is available.
|
||||
if command -v nix-shell && [ $NIX_PATH ] && [ -z $IN_NIX_SHELL ]; then
|
||||
cd ${NATIVE_DIR}
|
||||
nix-shell shell.nix --pure --run "./build.sh"
|
||||
nix-shell --pure --command "./build.sh $1"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Build libtsm.
|
||||
|
||||
# Update git submodules.
|
||||
LIBTSM_DIR=${NATIVE_DIR}/external/libtsm
|
||||
if [ ! -d "$LIBTSM_DIR" ]; then
|
||||
cd ${NATIVE_DIR}
|
||||
git submodule update --init --recursive -- $LIBTSM_DIR
|
||||
fi
|
||||
cd $LIBTSM_DIR
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DBUILD_SHARED_LIBS=n ..
|
||||
make
|
||||
|
||||
# Build godot-cpp.
|
||||
GODOT_CPP_DIR=${NATIVE_DIR}/external/godot-cpp
|
||||
if [ ! -d "${GODOT_CPP_DIR}" ]; then
|
||||
cd ${NATIVE_DIR}
|
||||
git submodule update --init --recursive -- $GODOT_CPP_DIR
|
||||
fi
|
||||
cd $GODOT_CPP_DIR
|
||||
scons platform=linux generate_bindings=yes -j12
|
||||
|
||||
# Build godotxtermnative.
|
||||
|
||||
# Build libgodot-xterm.
|
||||
cd ${NATIVE_DIR}
|
||||
scons platform=linux
|
||||
case $1 in
|
||||
"release-all")
|
||||
# Cross-compile release build for all platforms.
|
||||
scons platform=linux bits=64 target=release -j$(nproc)
|
||||
if [ $IN_NIX_SHELL ]; then
|
||||
nix-shell --pure --argstr system i686-linux --run 'scons platform=linux bits=32 target=release -j$(nproc)'
|
||||
fi
|
||||
scons platform=windows bits=64 target=release -j$(nproc)
|
||||
#scons platform=windows bits=32 target=release -j$(nproc)
|
||||
#scons platform=osx bits=64 target=release -j$(nproc)
|
||||
;;
|
||||
*)
|
||||
# Default: Compile debug build for the current platform.
|
||||
scons -j$(nproc)
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue