Skip to content

Commit

Permalink
Build only libuv on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lihop committed Feb 19, 2024
1 parent 8dcd512 commit 8653105
Showing 1 changed file with 15 additions and 94 deletions.
109 changes: 15 additions & 94 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
import-assets:
if: false
name: "Import Assets"
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -33,6 +34,7 @@ jobs:
path: .godot/

build-linux:
if: false
name: Build (linux, ${{ matrix.arch }}, ${{ matrix.target }})
runs-on: ubuntu-22.04
strategy:
Expand Down Expand Up @@ -79,25 +81,12 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [web, macos, windows]
platform: [windows]
target: [release, debug]
bits: [64, 32]
exclude:
- platform: web
bits: 64
- platform: macos
bits: 32
include:
- platform: web
os: ubuntu-22.04
- platform: macos
os: macos-12
- platform: windows
os: windows-2022
- platform: web
arch: wasm32
- platform: macos
arch: universal
- platform: windows
bits: 64
arch: x86_64
Expand All @@ -108,96 +97,26 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache submodules
uses: ./.github/actions/cache-submodules
id: cache-submodules
with:
platform: ${{ matrix.platform }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
- name: Cache emscripten
if: ${{ matrix.platform == 'web' }}
uses: actions/cache@v3
env:
cache-name: cache-emscripten
with:
path: addons/godot_xterm/native/.emcache
key: emsdk-cache-${{ matrix.target }}-${{ hashFiles('**/*.c*', '**/*.h*') }}
restore-keys: |
emsdk-cache-${{ matrix.target }}-
- name: Install web build dependencies
if: ${{ matrix.platform == 'web' }}
uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.14
actions-cache-folder: emsdk-cache-${{ matrix.target }}
- name: Install additional web build dependencies
if: ${{ matrix.platform == 'web' }}
run: sudo apt-get update && sudo apt-get install -y scons gcc-multilib g++-multilib
- name: Install additional macos build dependencies
if: ${{ matrix.os == 'macos-12' }}
run: brew install scons
- name: Install additional windows build dependencies
if: ${{ matrix.os == 'windows-2022' }}
run: python -m pip install scons
- name: Setup MSVC command prompt
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.os == 'windows-2022' }}
if: ${{ matrix.platform == 'windows' }}
with:
arch: win${{ matrix.bits }}
- name: Setup cmake
if: steps.cache-submodules.outputs.cache-hit != 'true'
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: "3.23.2"
use-32bit: ${{ matrix.bits == 32 && matrix.os == 'windows-2022' }}
- name: Build libuv
if: steps.cache-submodules.outputs.cache-hit != 'true'
shell: bash
env:
PLATFORM: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
BITS: ${{ matrix.bits }}
run: |
cd addons/godot_xterm/native/thirdparty/libuv
args="-DCMAKE_BUILD_TYPE=$TARGET -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64"
if [ "$PLATFORM" == "windows" ]; then
args="$args -DCMAKE_SHARED_LINKER_FLAGS=\"/WX\""
if [ "$TARGET" == "release" ]; then
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_C_FLAGS=\"/MD /utf-8\""
else
args="$args -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug -DCMAKE_C_FLAGS=\"/MDd /utf-8\""
fi
fi
if [ "$BITS" -eq 32 -a "$PLATFORM" == "windows" ]; then
cmake -G "Visual Studio 17 2022" -A Win32 -S $(pwd) -B "build" $args
else
rm -rf build
mkdir -p build
cd build
if [ "$BITS" -eq 32 ]; then args="$args -DCMAKE_SYSTEM_PROCESSOR=i686 -DCMAKE_C_FLAGS=-m32"; fi
cmake .. $args
cd ..
fi
cmake --build build --config $TARGET
- name: Ensure scons cache exists
run: mkdir -p ${{github.workspace}}/.scons-cache
use-32bit: ${{ matrix.bits == 32 && matrix.platform == 'windows' }}
- name: Build and test libuv
working-directory: addons/godot_xterm/native/thirdparty/libuv
shell: bash
- name: Build libgodot-xterm
env:
SCONS_CACHE: ${{github.workspace}}/.scons-cache
run: |
cd addons/godot_xterm/native
scons platform=${{ matrix.platform }} target=template_${{ matrix.target }} arch=${{ matrix.arch }}
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: libgodot-xterm-${{ matrix.target }}
path: |
addons/godot_xterm/native/bin/*.wasm
addons/godot_xterm/native/bin/*.dylib
addons/godot_xterm/native/bin/*.dll
mkdir -p build
pushd build
cmake .. -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DCMAKE_C_FLAGS_RELEASE="/MT" -DCMAKE_C_FLAGS_DEBUG="/MTd"
popd
cmake --build build --config ${{ matrix.target }} -j2
build/uv_run_tests_a
html5-export:
if: false # Temporarily disabled.
Expand Down Expand Up @@ -331,6 +250,7 @@ jobs:

# Git archive should only include addons/godot_xterm directory.
check-archive:
if: false
name: "Check Archive"
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -365,6 +285,7 @@ jobs:
fi
check-pre-commit:
if: false
name: "Check Pre-Commit"
runs-on: ubuntu-22.04
steps:
Expand Down

0 comments on commit 8653105

Please sign in to comment.