From 49ba8b03c4ebab4a28fa75cfb64694f84816b8ed Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 15 Jan 2019 14:36:25 -0500 Subject: add src/msi/ and sok.msi custom target --- meson.build | 24 +++++++- src/msi/README.md | 22 ++++++++ src/msi/sok.wxs | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+), 3 deletions(-) create mode 100644 src/msi/README.md create mode 100644 src/msi/sok.wxs diff --git a/meson.build b/meson.build index d9dca9d..0f515f2 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,15 @@ project('sok', 'c', default_options: ['c_std=c11']) +# MSI settings +MSI_SDL_LIB_DIR = '/usr/local/x86_64-w64-mingw32/bin' + # find libm (used for SDL version) cc = meson.get_compiler('c') libm = cc.find_library('m', required: true) +# find wixl (used for windows version) +wixl = find_program('wixl', native: true, disabler: true) + # core source (shared across all applications) sources = [ 'src/core/sok-level-parser.c', @@ -16,13 +22,12 @@ sources = [ # text UI executable('text', sources + [ 'src/levels/levels.c', - 'src/text/main.c', - 'src/text/action.c', + 'src/text/main.c', 'src/text/action.c', 'src/text/draw.c', ], dependencies: []) # sdl (main) exe -executable('sok', sources + [ +sok_exe = executable('sok', sources + [ 'src/levels/levels.c', 'src/sdl/warp-buf.c', 'src/sdl/color.c', @@ -41,6 +46,19 @@ executable('sok', sources + [ libm, ]) +# sok.msi +custom_target('msi', + input: 'src/msi/sok.wxs', + output: 'sok.msi', + command: [ + wixl, + '-o', '@OUTPUT@', + '-D', 'BUILD_DIR=.', + '-D', 'SDL_LIB_DIR=' + MSI_SDL_LIB_DIR, + '@INPUT@', + ] +) + # sprite-packer exe executable('sprite-packer', [ 'src/sprite-packer/main.c', diff --git a/src/msi/README.md b/src/msi/README.md new file mode 100644 index 0000000..7d420f5 --- /dev/null +++ b/src/msi/README.md @@ -0,0 +1,22 @@ +Generate MSI installer for Windows. + +Setup: + + apt-get install wixl + +Build (using sok.msi build target): + + ninja sok.msi + +Dependencies: + +* `SDL2-devel` (from libsdl.org) +* `SDL2_ttf-devel` (from libsdl.org) + +Example (generate by hand): + + # generate sok.msi + wixl -o sok.msi \ + -D BUILD_DIR=../../build-w64 \ + -D SDL_LIB_DIR=/usr/local/x86_64-w64-mingw32/bin \ + sok.wxs diff --git a/src/msi/sok.wxs b/src/msi/sok.wxs new file mode 100644 index 0000000..2a15cfa --- /dev/null +++ b/src/msi/sok.wxs @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3