Skip to content
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
34 changes: 12 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: build

on: [push, pull_request]

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

jobs:
build:
name: ${{ matrix.preset }}
Expand All @@ -27,11 +24,9 @@ jobs:
- preset: linux-release
os: ubuntu-latest
triplet: x64-linux
toolchain: /usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
- preset: windows-release
os: windows-latest
triplet: x64-mingw-dynamic
toolchain: C:/vcpkg/scripts/buildsystems/vcpkg.cmake
exclude:
- os: ubuntu-latest
preset: windows-release
Expand All @@ -46,13 +41,6 @@ jobs:
with:
cmakeVersion: "3.31.5"

- name: Enable GitHub Actions cache
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Install CSFML dependencies
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
Expand Down Expand Up @@ -90,21 +78,23 @@ jobs:
run: ./download_csfml.sh

- name: Install vcpkg dependencies
run: |
vcpkg install sfml --triplet=${{ matrix.triplet }} --overlay-ports=vcpkg
uses: johnwason/vcpkg-action@v7
id: vcpkg
with:
pkgs: sfml
triplet: ${{ matrix.triplet }}
extra-args: --overlay-ports=${{ github.workspace }}/vcpkg
token: ${{ secrets.GITHUB_TOKEN }}
vcpkg-subdir: 'vcpkg-repo'

- name: Build CSFML
run: |
cd csfml
cmake --preset ${{ matrix.preset }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }}
cmake --preset ${{ matrix.preset }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg-repo/scripts/buildsystems/vcpkg.cmake
cmake --build --preset ${{ matrix.preset }} --target install

- name: Build and test cjsfml
if: runner.os == 'Linux'
run: |
cjpm build
cjpm test

- name: Build cjsfml
if: runner.os == 'Windows'
run: cjpm build

- name: Test cjsfml
run: cjpm test
8 changes: 7 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"binaryDir": "${sourceDir}/build",
"installDir": "${sourceDir}/install",
"cacheVariables": {
"BUILD_SHARED_LIBS": true
"BUILD_SHARED_LIBS": true,
"CMAKE_ARCHIVE_OUTPUT_DIRECTORY": "${sourceDir}/",
"CMAKE_LIBRARY_OUTPUT_DIRECTORY": "${sourceDir}/",
"CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${sourceDir}/"
},
"condition": {
"type": "equals",
Expand Down Expand Up @@ -40,6 +43,9 @@
"installDir": "${sourceDir}/install",
"cacheVariables": {
"BUILD_SHARED_LIBS": true,
"CMAKE_ARCHIVE_OUTPUT_DIRECTORY": "${sourceDir}/",
"CMAKE_LIBRARY_OUTPUT_DIRECTORY": "${sourceDir}/",
"CMAKE_RUNTIME_OUTPUT_DIRECTORY": "${sourceDir}/",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_TOOLCHAIN_FILE": {
Expand Down
10 changes: 5 additions & 5 deletions cjpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
endian = { git = "https://github.com/causerp/endian.git", tag = "v1.1.0"}

[ffi.c]
csfml-audio = { path = "./csfml/install/lib" }
csfml-graphics = { path = "./csfml/install/lib" }
csfml-network = { path = "./csfml/install/lib" }
csfml-system = { path = "./csfml/install/lib" }
csfml-window = { path = "./csfml/install/lib" }
csfml-audio = { path = "./csfml" }
csfml-graphics = { path = "./csfml" }
csfml-network = { path = "./csfml" }
csfml-system = { path = "./csfml" }
csfml-window = { path = "./csfml" }
Loading