forked from EasyRPG/liblcf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better use as submodule, without install target (useful for flatpak) Prevent in-source builds
- Loading branch information
1 parent
c94ff83
commit 872ccad
Showing
3 changed files
with
103 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ on: | |
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
@@ -20,17 +24,12 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
image: | ||
- debian:10 # CMake 3.13.4 - g++ 8.3.0 - oldstable | ||
- ubuntu:20.04 # CMake 3.16.3 - g++ 9.3.0 - LTS | ||
- debian:11 # CMake 3.18.4 - g++ 10.2.1 - stable | ||
- debian:11 # CMake 3.18.4 - g++ 10.2.1 - oldstable | ||
- ubuntu:22.04 # CMake 3.22.1 - g++ 11.2.0 - LTS | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- debian:12 # CMake 3.25.1 - g++ 12.2.0 - stable | ||
|
||
steps: | ||
- name: Install dependencies | ||
run: | | ||
export DEBIAN_FRONTEND="noninteractive" | ||
|
@@ -39,6 +38,9 @@ jobs: | |
build-essential cmake ninja-build git \ | ||
libicu-dev libexpat1-dev | ||
- name: Clone Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Compile | ||
run: | | ||
cmake -G Ninja -B build . \ | ||
|
@@ -47,9 +49,7 @@ jobs: | |
- name: Install | ||
run: | | ||
export DESTDIR=$PWD/local-install | ||
# cmake < 3.16 does not support '--install' | ||
cmake --build build --target install | ||
cmake --install build | ||
- name: Test | ||
run: cmake --build build --target check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
# check if we are a submodule | ||
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) | ||
set(LIBLCF_MAIN_PROJECT ON) | ||
else() | ||
set(LIBLCF_MAIN_PROJECT OFF) | ||
endif() | ||
|
||
# prevent in-source builds | ||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) | ||
message(FATAL_ERROR "In-source builds are disabled.") | ||
endif() |