Skip to content

Commit

Permalink
Add windows cross-compilation + artifact build script
Browse files Browse the repository at this point in the history
Closes #48.
Closes #64.
  • Loading branch information
tiehuis committed Jul 13, 2017
1 parent ad57778 commit 713cab7
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
src/frontend/SDL2/*.inc linguist-vendored
src/frontend/SDL2/*.inc linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ fs.log
fs.hiscore
replay/*
build
artifacts
55 changes: 55 additions & 0 deletions build_all
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

# Dependencies:
# - jq
# - meson
# - ninja
# - xorriso
# - zip
# - mingw32-x86_64 toolchain
# - i686-elf-gcc
# - nasm
# - xorriso
# - mtools

VERSION=$(mesonintrospect --projectinfo build | jq -r .version)

rm -rf artifacts
mkdir -p artifacts

# Linux Releases
rm -rf build
LGT_V=faststack-$VERSION-unknown-linux-glibc
mkdir -p artifacts/$LGT_V
mkdir -p artifacts/$LGT_V/replay
meson build -Dfrontend=terminal
ninja -C build
cp build/faststack artifacts/$LGT_V/faststack-terminal
rm -rf build
meson build -Dfrontend=sdl
ninja -C build
cp build/faststack artifacts/$LGT_V/faststack-sdl2
cp examples/fs.ini artifacts/$LGT_V
cd artifacts && tar -czvf $LGT_V.tar.gz $LGT_V && cd ..
rm -rf artifacts/$LGT_V

# Windows Releases
rm -rf build
WG_V=faststack-$VERSION-x86_64-windows-gnu
mkdir -p artifacts/$WG_V
mkdir -p artifacts/$WG_V/replay
meson build -Dfrontend=sdl --cross-file=meson_cross.txt
ninja -C build
cp build/faststack artifacts/$WG_V
cp examples/fs.ini artifacts/$WG_V
cp dlls/libfreetype-6.dll dlls/SDL2.dll dlls/SDL2_ttf.dll dlls/zlib1.dll artifacts/$WG_V
cd artifacts && zip -9 -r $WG_V.zip $WG_V && cd ..
rm -rf artifacts/$WG_V

# Iso Releases
make -C src/frontend/kernel iso
cp src/frontend/kernel/stackos.iso artifacts/stackos-$VERSION-x86.iso

# Source Code Releases
ninja -C build dist
cp build/meson-dist/*.tar.xz artifacts
Binary file added dlls/SDL2.dll
Binary file not shown.
Binary file added dlls/SDL2_ttf.dll
Binary file not shown.
Binary file added dlls/libfreetype-6.dll
Binary file not shown.
Binary file added dlls/zlib1.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
project('faststack', 'c',
version : '0.3.0',
version : '0.3.1',
license : 'GPLv3'
)

add_project_arguments(['-Wall', '-Wextra', '-std=c99', '-pedantic'],
language : 'c'
)

if meson.is_cross_build()
add_project_link_arguments(['-L../dlls'], language : 'c')
endif

subdir('src/engine')

src = []
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/SDL2/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <faststack.h>

#include <stdio.h>

#define SDL_MAIN_HANDLED
#include <SDL.h>
#include <SDL_FontCache.h>

Expand Down

0 comments on commit 713cab7

Please sign in to comment.