Skip to content

Commit

Permalink
Merge pull request #2155 from AlecTroemel/janet-v1.27
Browse files Browse the repository at this point in the history
Upgrade janet to 1.27, add mingw workflow build
  • Loading branch information
nesbox authored Apr 3, 2023
2 parents 40c5f2d + 48b8138 commit 31ea041
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 18 deletions.
39 changes: 38 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,43 @@ jobs:
name: "tic80-windows-sokol"
path: build/bin/tic80.exe

# === Windows MinGW 64 using msys ===
windows-msys-mingw:
runs-on: windows-2019

steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6

- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-pkg-config
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Configure CMake
shell: msys2 {0}
run: cmake -B build -G "MSYS Makefiles" -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=%BUILD_TYPE%

- name: build
shell: msys2 {0}
run: cmake --build build/ --config $BUILD_TYPE --parallel

- name: Deploy
uses: actions/upload-artifact@v3
with:
name: "tic80-mingw"
path: build/bin/tic80.exe

# === Ubuntu PRO ===
linux-pro:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -576,7 +613,7 @@ jobs:
cp bin/tic80*.js bin/html-export/
cp bin/tic80*.wasm bin/html-export/
cp html/index.html bin/html/index.html
cp html/export.html bin/html/export.html
cp html/export.html bin/html/export.html
cp bin/tic80.js bin/html/tic80.js
cp bin/tic80.wasm bin/html/tic80.wasm
cp bin/tic80.js webapp/tic80.js
Expand Down
31 changes: 19 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,18 @@ option(BUILD_WITH_JANET "Janet Enabled" ${BUILD_WITH_JANET_DEFAULT})
message("BUILD_WITH_JANET: ${BUILD_WITH_JANET}")

if(BUILD_WITH_JANET)
if(MSVC)

if(MINGW)
add_custom_command(
OUTPUT ${THIRDPARTY_DIR}/janet/build/c/janet.c
COMMAND ./build_win.bat
WORKING_DIRECTORY ${THIRDPARTY_DIR}/janet/
OUTPUT ${THIRDPARTY_DIR}/janet/build/c/janet.c
COMMAND mingw32-make build/c/janet.c
WORKING_DIRECTORY ${THIRDPARTY_DIR}/janet/
)
elseif(WIN32)
add_custom_command(
OUTPUT ${THIRDPARTY_DIR}/janet/build/c/janet.c
COMMAND ./build_win.bat
WORKING_DIRECTORY ${THIRDPARTY_DIR}/janet/
)
else()
add_custom_command(
Expand Down Expand Up @@ -506,14 +513,14 @@ macro(MACRO_CORE SCRIPT DEFINE BUILD_DEPRECATED)
${CMAKE_SOURCE_DIR}/src)

target_link_libraries(tic80core${SCRIPT}
lua
lpeg
wren
wasm
squirrel
scheme
duktape
blipbuf
lua
lpeg
wren
wasm
squirrel
scheme
duktape
blipbuf
zlib
)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cmake -G "Visual Studio 15 2017 Win64" ..
- install `git`
- install `cmake` (https://cmake.org)
- install `Ruby` (you can use [RubyInstaller](https://rubyinstaller.org/))
- run following commands in `terminal`
- run following commands within a `mingw64` context, for example within a MingW64 shell
```
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
cmake -G "MinGW Makefiles" ..
Expand Down
6 changes: 3 additions & 3 deletions build/janet/janetconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#define JANETCONF_H

#define JANET_VERSION_MAJOR 1
#define JANET_VERSION_MINOR 26
#define JANET_VERSION_MINOR 27
#define JANET_VERSION_PATCH 1
#define JANET_VERSION_EXTRA "-dev"
#define JANET_VERSION "1.26.1-dev"
#define JANET_VERSION_EXTRA ""
#define JANET_VERSION "1.27.0"

/* #define JANET_BUILD "local" */

Expand Down

0 comments on commit 31ea041

Please sign in to comment.