Skip to content

Commit c2c5a74

Browse files
authored
Update sol2 (#16)
* Update sol2 to 3.5.0 (Fixes #15 - compilation error on FreeBSD) * Update luarocks in CI scripts * Update actions/checkout * Only run workflows once in PRs
1 parent f9ee400 commit c2c5a74

6 files changed

Lines changed: 41 additions & 22 deletions

File tree

.github/workflows/buildAndTest-Linux.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "Build and Test on Ubuntu"
2-
on: ["push", "pull_request"]
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
37

48
jobs:
59
RunTestsOnLinux:
@@ -17,7 +21,7 @@ jobs:
1721
"liblua5.1-0-dev lua5.1",
1822
]
1923
steps:
20-
- uses: "actions/checkout@v4"
24+
- uses: "actions/checkout@v6"
2125
- name: "Add Dependencies"
2226
run: |
2327
export COMPILER=${{ matrix.compiler }}

.github/workflows/buildAndTest-MacOS.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "Build and Test on MacOS"
2-
on: ["push", "pull_request"]
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
37

48
jobs:
59
RunTestsOnMac:
@@ -10,7 +14,7 @@ jobs:
1014
lua: ["lua", "luajit"]
1115
compiler: ["gcc", "clang"]
1216
steps:
13-
- uses: "actions/checkout@v4"
17+
- uses: "actions/checkout@v6"
1418
- name: "Install Dependencies"
1519
run: |
1620
brew install ${{ matrix.lua }} luarocks
@@ -24,8 +28,13 @@ jobs:
2428
luarocks install luaunit
2529
- name: "Build Project"
2630
run: |
27-
export CXX_COMPILER="$(brew --prefix)/bin/g++-13"
28-
export C_COMPILER="$(brew --prefix)/bin/gcc-13"
31+
if [[ "${{ matrix.compiler }}" = "gcc" ]]; then
32+
export CXX_COMPILER="$(brew --prefix)/bin/g++-13"
33+
export C_COMPILER="$(brew --prefix)/bin/gcc-13"
34+
else
35+
export CXX_COMPILER="$(which clang++)"
36+
export C_COMPILER="$(which clang)"
37+
fi
2938
CXX="$CXX_COMPILER" CC="$C_COMPILER" luarocks make
3039
- name: "Test Project"
3140
run: "lua tests/tests.lua"

.github/workflows/buildAndTest-Windows.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "Build and Test on Windows"
2-
on: ["push", "pull_request"]
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
37

48
jobs:
59
RunTestsOnWindows:
@@ -9,23 +13,23 @@ jobs:
913
matrix:
1014
compiler: ["LLVM", "MinGW", "MSVC"]
1115
steps:
12-
- uses: "actions/checkout@v4"
16+
- uses: "actions/checkout@v6"
1317
- name: "Install Dependencies"
1418
run: "choco install -y cmake ninja"
1519
- name: "Build LuaJIT"
1620
run: "powershell scripts/buildLuaJIT.ps1"
1721
- name: "Install LuaRocks"
1822
run: "powershell scripts/installLuaRocks.ps1; mkdir LuaRocks/tree"
1923
- name: "Set up LLVM"
20-
if: "${{ matrix.compiler == 'LLVM' }}"
24+
if: ${{ matrix.compiler == 'LLVM' }}
2125
uses: "egor-tensin/setup-clang@v1"
2226
- name: "Set up MinGW"
23-
if: "${{ matrix.compiler == 'MinGW' }}"
27+
if: ${{ matrix.compiler == 'MinGW' }}
2428
uses: "e-t-l/setup-mingw@patch-1"
2529
with:
2630
platform: "x64"
2731
- name: "Set up MSVC"
28-
if: "${{ matrix.compiler == 'MSVC' }}"
32+
if: ${{ matrix.compiler == 'MSVC' }}
2933
uses: "compnerd/gha-setup-vsdevenv@main"
3034
- name: "Configure Project"
3135
run: |

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ FetchContent_Declare(
4949
GIT_REPOSITORY "https://github.com/ThePhD/sol2.git"
5050
GIT_SHALLOW ON
5151
GIT_SUBMODULES ""
52-
GIT_TAG "v3.3.0"
52+
GIT_TAG "v3.5.0"
5353
)
5454

5555
FetchContent_Declare(
@@ -69,6 +69,8 @@ endif()
6969
FetchContent_GetProperties(${SOL2})
7070
if(NOT ${SOL2}_POPULATED)
7171
message(STATUS "Cloning ${SOL2}")
72+
option(SOL2_ENABLE_INSTALL "Enable installation of Sol2" ON)
73+
set(SOL2_ENABLE_INSTALL OFF)
7274
FetchContent_MakeAvailable(${SOL2})
7375
endif()
7476

scripts/buildLuaRocks.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22

3-
sudo apt install build-essential libreadline-dev unzip wget
4-
wget https://luarocks.org/releases/luarocks-3.11.0.tar.gz
5-
tar -zxpf luarocks-3.11.0.tar.gz
6-
rm luarocks-3.11.0.tar.gz
7-
cd luarocks-3.11.0
3+
sudo apt install build-essential libreadline-dev unzip wget make -yq
4+
wget "https://luarocks.org/releases/luarocks-3.12.2.tar.gz"
5+
tar -zxpf luarocks-3.12.2.tar.gz
6+
rm luarocks-3.12.2.tar.gz
7+
cd luarocks-3.12.2
88
./configure
99
make
1010
sudo make install
11-
mkdir ~/.luarocks
11+
mkdir ~/.luarocks

scripts/installLuaRocks.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ if (-not (Test-Path -Path $installDir)) {
99

1010
$installDir = Resolve-Path $installDir
1111

12-
Invoke-WebRequest -Uri "http://luarocks.github.io/luarocks/releases/luarocks-3.11.0-windows-32.zip" -OutFile "luarocks.zip"
12+
Invoke-WebRequest -Uri "http://luarocks.github.io/luarocks/releases/luarocks-3.12.2-windows-32.zip" -OutFile "luarocks.zip"
1313
Expand-Archive -Path "luarocks.zip" -DestinationPath "."
14-
Move-Item -Path "luarocks-3.11.0-windows-32\luarocks.exe" -Destination "$($installDir)"
15-
Move-Item -Path "luarocks-3.11.0-windows-32\luarocks-admin.exe" -Destination "$($installDir)"
14+
Move-Item -Path "luarocks-3.12.2-windows-32\luarocks.exe" -Destination "$($installDir)"
15+
Move-Item -Path "luarocks-3.12.2-windows-32\luarocks-admin.exe" -Destination "$($installDir)"
1616

1717
Remove-Item "luarocks.zip"
18-
Remove-Item -Recurse -Force "luarocks-3.11.0-windows-32"
18+
Remove-Item -Recurse -Force "luarocks-3.12.2-windows-32"

0 commit comments

Comments
 (0)