diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da80fe1..64449a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/.gitmodules b/.gitmodules index ec26e87..bb8e51b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/addons/godot_xterm/native/SConstruct b/addons/godot_xterm/native/SConstruct index 6312e86..c483f95 100644 --- a/addons/godot_xterm/native/SConstruct +++ b/addons/godot_xterm/native/SConstruct @@ -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" diff --git a/addons/godot_xterm/native/build.sh b/addons/godot_xterm/native/build.sh index d545a18..1da7cab 100755 --- a/addons/godot_xterm/native/build.sh +++ b/addons/godot_xterm/native/build.sh @@ -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 diff --git a/addons/godot_xterm/native/thirdparty/godot-cpp b/addons/godot_xterm/native/thirdparty/godot-cpp index b8eebe5..26d4df4 160000 --- a/addons/godot_xterm/native/thirdparty/godot-cpp +++ b/addons/godot_xterm/native/thirdparty/godot-cpp @@ -1 +1 @@ -Subproject commit b8eebe5eb61f1b22d2d829cccef264138b106cdb +Subproject commit 26d4df4e174124e1174c624d770661b1394fcf5f