Fix windows builds

- Fixes build error for windows debug 32bit.
- Allows building windows release with PTY enabled.
- Updates godot-cpp.
This commit is contained in:
Leroy Hopson 2021-07-18 16:06:38 +07:00
parent 84243cd824
commit 8bc3a13adb
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
5 changed files with 25 additions and 12 deletions

View file

@ -43,7 +43,7 @@ jobs:
cache-name: cache-godot-cpp
with:
path: addons/godot_xterm/native/thirdparty/godot-cpp
key: godot-cpp-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.GODOT_CPP_COMMIT_HASH }}
key: godot-cpp-v1-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.GODOT_CPP_COMMIT_HASH }}
- name: Get libuv submodule commit hash
shell: bash
env:
@ -55,7 +55,7 @@ jobs:
id: cache-libuv
with:
path: addons/godot_xterm/native/thirdparty/libuv
key: libuv-cache-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.LIBUV_COMMIT_HASH }}
key: libuv-cache-v1-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.LIBUV_COMMIT_HASH }}
- name: Cache emscripten
if: ${{ matrix.platform == 'javascript' }}
uses: actions/cache@v2
@ -63,7 +63,7 @@ jobs:
cache-name: cache-emscripten
with:
path: addons/godot_xterm/native/.emcache
key: emsdk-cache-${{ matrix.target }}
key: emsdk-cache-v1-${{ matrix.target }}
# Ubuntu-specific steps.
- name: Install ubuntu build dependencies
@ -114,6 +114,11 @@ jobs:
run: |
cd addons/godot_xterm/native/thirdparty/libuv
args="-DCMAKE_BUILD_TYPE=$TARGET -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE"
if [ "$TARGET" == "release" ]; then
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL"
else
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL"
fi
if [ "$BITS" -eq 32 -a "$OS" == "windows-latest" ]; then
cmake -G "Visual Studio 16 2019" -A Win32 -S $(pwd) -B "build" $args
else
@ -128,8 +133,7 @@ jobs:
- name: Build libgodot-xterm
run: |
cd addons/godot_xterm/native
# Disable PTY on release windows builds as it has linking errors when built on GithHub actions.
scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} disable_pty=${{ matrix.target == 'release' && matrix.platform == 'windows' && 'yes' || 'no' }} -j2
scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} -j2
- name: Upload build artifacts
uses: actions/upload-artifact@v2

2
.gitmodules vendored
View file

@ -14,3 +14,5 @@
url = https://github.com/lihop/libuv
[submodule "libuv"]
url = https://github.com/libuv/libuv
[submodule "godot-cpp/"]
url = https://github.com/godotengine/godot-cpp

View file

@ -123,7 +123,7 @@ elif env['platform'] == 'javascript':
env['OBJSUFFIX'] = '.bc'
env['PROGPREFIX'] = ''
env['PROGSUFFIX'] = ''
env['LIBSUFFIX'] = '.bc'
env['LIBSUFFIX'] = '.a'
env['LIBPREFIXES'] = ['$LIBPREFIX']
env['LIBSUFFIXES'] = ['$LIBSUFFIX']
env.Replace(SHLINKFLAGS='$LINKFLAGS')
@ -162,11 +162,10 @@ elif env['platform'] == 'windows':
# On Windows using MSVC.
if host_platform == 'windows':
env.Append(LINKFLAGS=['/W3', '/GR'])
if env['target'] == 'debug':
env.Append(CCFLAGS=['/Z7', '/Od', '/EHsc', '/D_DEBUG', '/MDd'])
elif env['target'] == 'release':
env.Append(CCFLAGS=['/O2', '/EHsc', '/DNDEBUG', '/MT'])
env.Append(CCFLAGS=['/O2', '/EHsc', '/DNDEBUG', '/MD'])
# On Windows, Linux, or MacOS using MinGW.
elif host_platform == 'linux' or host_platform == 'osx':
@ -227,7 +226,9 @@ Default(libtsm)
# Build libgodot-xterm.
env.Append(CXXFLAGS=['-std=c++14'])
if env['platform'] != 'windows':
env.Append(CXXFLAGS=['-std=c++14'])
env.Append(CPPPATH=[
'src/',
'thirdparty/libtsm/build/src/tsm',
@ -288,7 +289,7 @@ if env['platform'] == 'linux':
libsuffix = "a"
suffix = "so"
elif env['platform'] == 'javascript':
libsuffix = "bc"
libsuffix = "a"
suffix = "wasm"
elif env['platform'] == 'windows':
libsuffix = "lib"

View file

@ -64,7 +64,13 @@ scons generate_bindings=yes target=$target -j$nproc
cd ${LIBUV_DIR}
mkdir build || true
cd build
cmake .. -DCMAKE_BUILD_TYPE=$target -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE
args="-DCMAKE_BUILD_TYPE=$target -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE"
if [ "$target" == "release" ]; then
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL"
else
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL"
fi
cmake .. $args
cd ..
cmake --build build --config $target -j$nproc

@ -1 +1 @@
Subproject commit b8eebe5eb61f1b22d2d829cccef264138b106cdb
Subproject commit 26d4df4e174124e1174c624d770661b1394fcf5f