Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Windows binary with Linux GCC #96

Merged
merged 4 commits into from
Dec 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,32 @@ on:

jobs:
windows:
runs-on: windows-latest
name: windows ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: i686
bits: "32"
- target: x86-64
bits: "64"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.5
- name: install deps
run: |
nuget restore build/vs2019/asmsx.sln
nuget install build/vs2019/asmsx-gtest/packages.config -OutputDirectory build/vs2019/asmsx-gtest/packages
choco install winflexbison
sudo apt update
sudo apt install -y libbison-dev libfl-dev build-essential cmake flex bison libpthread-stubs0-dev libgtest-dev
sudo apt install -y gcc-mingw-w64-${{ matrix.target }} g++-mingw-w64-${{ matrix.target }}
- name: make
run: msbuild build/vs2019/asmsx.sln
run: make asmsx${{ matrix.bits }}.exe
- name: upload artifact
uses: actions/upload-artifact@v2
with:
name: asmsx-win-x86_64
path: build/vs2019/Debug/asmsx.exe
name: asmsx-win-${{ matrix.target }}
path: asmsx*.exe

linux:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ src/%.o: src/%.c

debug: asmsx-debug
asmsx.osx: CC := o64-clang
asmsx.exe: CROSS_COMPILE := i686-w64-mingw32-
asmsx.exe: asmsx32.exe
asmsx32.exe: CROSS_COMPILE := i686-w64-mingw32-
asmsx64.exe: CROSS_COMPILE := x86_64-w64-mingw32-
asmsx.arm: CROSS_COMPILE := arm-linux-gnueabi-
asmsx.arm: CFLAGS += -march=armv6
asmsx-debug: CFLAGS := -Og -ggdb
asmsx-debug: FLEX_FLAGS += -d
asmsx-debug: BISON_FLAGS += --graph -t
asmsx asmsx.osx asmsx.exe asmsx.arm: $(ALL_FILES) $(HEADERS)
asmsx asmsx.osx asmsx.exe asmsx32.exe asmsx64.exe asmsx.arm: $(ALL_FILES) $(HEADERS)
$(CROSS_COMPILE)$(CC) $(ALL_FILES) -o$@ $(LDFLAGS) $(CFLAGS) $(LIBS) $(OPTS)

asmsx-debug: $(ALL_FILES) $(HEADERS) src/dura.y src/lex.l
Expand Down