From 4cc2115125730dbad2a645e22a1eeea22d7abdb3 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Sun, 22 Nov 2020 22:16:38 +0700 Subject: [PATCH] Build windows releases with /MT rather than /MD When making a release export of a project, binaries built with the /MD flag do not work. --- .github/workflows/main.yml | 12 ++++++++---- CHANGELOG.md | 2 ++ addons/godot_xterm/native/SConstruct | 2 +- addons/godot_xterm/native/external/godot-cpp | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5fd325..e247aef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,11 +7,12 @@ on: branches: [ master ] jobs: - release-build: + build: runs-on: ${{ matrix.os }} strategy: matrix: platform: [ linux, osx, windows ] + target: [ release, debug ] bits: [ 64, 32 ] include: - platform: linux @@ -43,16 +44,19 @@ jobs: cache-name: cache-godot-cpp with: path: addons/godot_xterm/native/external/godot-cpp - key: godot-cpp-${{ matrix.platform }}-release-${{ matrix.bits }}-${{ env.GODOT_CPP_COMMIT_HASH }} + key: godot-cpp-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.bits }}-${{ env.GODOT_CPP_COMMIT_HASH }} + # Ubuntu-specific steps. - name: Install ubuntu build dependencies if: ${{ matrix.os == 'ubuntu-latest' }} run: sudo apt-get install -y scons gcc-multilib g++-multilib + # MacOS-specific steps. - name: Install additional macos build dependencies if: ${{ matrix.os == 'macos-latest' }} run: brew install scons + # Windows-specific steps. - name: Install additional windows build dependencies if: ${{ matrix.os == 'windows-latest' }} run: choco install python3 && python -m pip install scons @@ -63,12 +67,12 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: | cd addons/godot_xterm/native/external/godot-cpp - scons platform=${{ matrix.platform }} target=release bits=${{ matrix.bits }} generate_bindings=yes -j2 + scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} generate_bindings=yes -j2 - name: Build libgodot-xterm run: | cd addons/godot_xterm/native - scons platform=${{ matrix.platform }} target=release bits=${{ matrix.bits }} -j2 + scons platform=${{ matrix.platform }} target=${{ matrix.target }} bits=${{ matrix.bits }} -j2 - name: Upload build artifacts uses: actions/upload-artifact@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f08049..a072b97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- For windows release builds, use the /MT flag rather than /MD. When built with /MD the plugin does not work with exported projects. ## [v1.2.0] - 2020-11-21 diff --git a/addons/godot_xterm/native/SConstruct b/addons/godot_xterm/native/SConstruct index 65baf28..ceb1e25 100644 --- a/addons/godot_xterm/native/SConstruct +++ b/addons/godot_xterm/native/SConstruct @@ -128,7 +128,7 @@ elif env['platform'] == 'windows': if env['target'] == 'debug': env.Append(CCFLAGS=['/Z7', '/Od', '/EHsc', '/D_DEBUG', '/MDd']) elif env['target'] == 'release': - env.Append(CCFLAGS=['/O2', '/EHsc', '/DNDEBUG', '/MD']) + env.Append(CCFLAGS=['/O2', '/EHsc', '/DNDEBUG', '/MT']) # On Windows, Linux, or MacOS using MinGW. elif host_platform == 'linux' or host_platform == 'osx': diff --git a/addons/godot_xterm/native/external/godot-cpp b/addons/godot_xterm/native/external/godot-cpp index 20d57e6..28853fd 160000 --- a/addons/godot_xterm/native/external/godot-cpp +++ b/addons/godot_xterm/native/external/godot-cpp @@ -1 +1 @@ -Subproject commit 20d57e6cf5d0353de0905f4edd3697b6de32bc74 +Subproject commit 28853fd110dbbc70581ea0a257a0d89febef66aa