Skip to content

Commit 856fdb9

Browse files
authored
[v0.4.2] Upgrade and vendor deps (#28)
* [v0.4.2] Upgrade and vendor deps * Cleanup, update CI scripts * Add install step for cli and release script * release: fix exe name * CI: Install Wayland/X11 deps * CI: Remove install test
1 parent 38a9fb0 commit 856fdb9

20 files changed

Lines changed: 466 additions & 191 deletions

.github/format_check_diff.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
[[ ! $(git --version) ]] && exit 1
4+
5+
output=$(git diff)
6+
7+
if [[ "$output" != "" ]]; then
8+
echo -e "One or more source files are not formatted!\n\n$output\n"
9+
echo -e "Using $(clang-format --version)\n"
10+
exit 1
11+
fi
12+
13+
echo "All source files are formatted"
14+
exit

.github/workflows/ci.yml

Lines changed: 122 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,135 @@
1-
name: ci-push
2-
on: [push]
1+
name: ci-pr
2+
on: [pull_request, workflow_dispatch]
33
jobs:
4-
build-linux:
5-
runs-on: ubuntu-24.04
4+
format-check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: format code
9+
run: scripts/format_code.sh
10+
- name: check diff
11+
run: .github/format_check_diff.sh
12+
x64-linux-gcc:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: init
17+
run: |
18+
uname -m
19+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 10
20+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 10
21+
sudo apt update -yqq && sudo apt install -yqq mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
22+
- name: configure
23+
run: cmake -S . --preset=ninja-gcc -B build -DGLFW_BUILD_X11=OFF
24+
- name: build debug
25+
run: cmake --build build --config=Debug -- -v
26+
- name: build release
27+
run: cmake --build build --config=Release -- -v
28+
- name: test debug
29+
run: cd build && ctest -V -C Debug
30+
- name: test release
31+
run: cd build && ctest -V -C Release
32+
x64-linux-clang:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: init
37+
run: |
38+
uname -m
39+
sudo apt update -yqq && sudo apt install -yqq clang-20 mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
40+
sudo update-alternatives --remove-all clang++
41+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 10
42+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 10
43+
- name: configure
44+
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF
45+
- name: build debug
46+
run: cmake --build build --config=Debug -- -v
47+
- name: build release
48+
run: cmake --build build --config=Release -- -v
49+
- name: test debug
50+
run: cd build && ctest -V -C Debug
51+
- name: test release
52+
run: cd build && ctest -V -C Release
53+
arm64-linux-gcc:
54+
runs-on: ubuntu-24.04-arm
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: init
58+
run: |
59+
uname -m
60+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 10
61+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 10
62+
sudo apt update -yqq && sudo apt install -yqq mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
63+
- name: configure
64+
run: cmake -S . --preset=ninja-gcc -B build -DGLFW_BUILD_X11=OFF
65+
- name: build debug
66+
run: cmake --build build --config=Debug -- -v
67+
- name: build release
68+
run: cmake --build build --config=Release -- -v
69+
- name: test debug
70+
run: cd build && ctest -V -C Debug
71+
- name: test release
72+
run: cd build && ctest -V -C Release
73+
arm64-linux-clang:
74+
runs-on: ubuntu-24.04-arm
675
steps:
776
- uses: actions/checkout@v4
877
- name: init
978
run: |
10-
sudo apt update -yqq && sudo apt install -yqq ninja-build gcc-14 xorg-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
11-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
12-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
13-
- name: configure gcc
14-
run: cmake -S . --preset=default -B build
15-
- name: configure clang
16-
run: cmake -S . --preset=ninja-clang -B clang
17-
- name: build gcc debug
18-
run: cmake --build build --config=Debug
19-
- name: build gcc release
20-
run: cmake --build build --config=Release
21-
- name: build clang debug
22-
run: cmake --build clang --config=Debug
23-
- name: build clang release
24-
run: cmake --build clang --config=Release
25-
- name: test gcc debug
26-
run: cd build && ctest -C Debug
27-
- name: test gcc release
28-
run: cd build && ctest -C Release
29-
- name: test clang debug
30-
run: cd clang && ctest -C Debug
31-
- name: test clang release
32-
run: cd clang && ctest -C Release
33-
build-windows:
34-
runs-on: windows-latest
79+
uname -m
80+
sudo apt update -yqq && sudo apt install -yqq clang-20 mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
81+
sudo update-alternatives --remove-all clang++
82+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 10
83+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 10
84+
- name: configure
85+
run: cmake -S . --preset=ninja-clang -B build -DGLFW_BUILD_X11=OFF
86+
- name: build debug
87+
run: cmake --build build --config=Debug -- -v
88+
- name: build release
89+
run: cmake --build build --config=Release -- -v
90+
- name: test debug
91+
run: cd build && ctest -V -C Debug
92+
- name: test release
93+
run: cd build && ctest -V -C Release
94+
x64-windows-vs22:
95+
runs-on: windows-2025
3596
steps:
3697
- uses: actions/checkout@v4
3798
- name: configure
3899
run: cmake -S . --preset=vs22 -B build
39100
- name: build debug
40-
run: cmake --build build --config=Debug
101+
run: cmake --build build --config=Debug --parallel
102+
- name: build release
103+
run: cmake --build build --config=Release --parallel
104+
- name: test debug
105+
run: cd build && ctest -V -C Debug
106+
- name: test release
107+
run: cd build && ctest -V -C Release
108+
x64-windows-clang:
109+
runs-on: windows-2025
110+
steps:
111+
- uses: actions/checkout@v4
112+
- name: configure
113+
run: cmake -S . --preset=ninja-clang -B build
114+
- name: build debug
115+
run: cmake --build build --config=Debug -- -v
116+
- name: build release
117+
run: cmake --build build --config=Release -- -v
118+
- name: test debug
119+
run: cd build && ctest -V -C Debug
120+
- name: test release
121+
run: cd build && ctest -V -C Release
122+
x64-mingw-gcc:
123+
runs-on: windows-2025
124+
steps:
125+
- uses: actions/checkout@v4
126+
- name: configure
127+
run: cmake -S . --preset=ninja-gcc -B build
128+
- name: build debug
129+
run: cmake --build build --config=Debug -- -v
41130
- name: build release
42-
run: cmake --build build --config=Release
131+
run: cmake --build build --config=Release -- -v
43132
- name: test debug
44-
run: cd build && ctest -C Debug
133+
run: cd build && ctest -V -C Debug
45134
- name: test release
46-
run: cd build && ctest -C Release
135+
run: cd build && ctest -V -C Release

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: ci-release
2+
on:
3+
push:
4+
tags:
5+
'v*'
6+
workflow_dispatch:
7+
jobs:
8+
x64-linux-gcc:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: init
13+
run: |
14+
uname -m
15+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 10
16+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 10
17+
sudo apt update -yqq && sudo apt install -yqq mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev
18+
- name: configure
19+
run: cmake -S . --preset=ninja-gcc -B build -DLOCC_BUILD_TESTS=OFF -DLOCC_BUILD_GUI=OFF
20+
- name: build release
21+
run: cmake --build build --config=Release -- -v
22+
- name: install
23+
run: |
24+
cmake --install build --config=Release --prefix=.
25+
tar -acf x64-linux-locc-${{ github.ref_name }}.tar.xz bin/locc-cli
26+
- name: release
27+
uses: softprops/action-gh-release@v2.3.4
28+
with:
29+
token: ${{ secrets.RELEASE_TOKEN }}
30+
files: x64-linux-locc-${{ github.ref_name }}.tar.xz
31+
draft: true
32+
fail_on_unmatched_files: true
33+
arm64-linux-gcc:
34+
runs-on: ubuntu-24.04-arm
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: init
38+
run: |
39+
uname -m
40+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 10
41+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 10
42+
sudo apt update -yqq && sudo apt install -yqq mesa-common-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev
43+
- name: configure
44+
run: cmake -S . --preset=ninja-gcc -B build -DLOCC_BUILD_TESTS=OFF -DLOCC_BUILD_GUI=OFF
45+
- name: build release
46+
run: cmake --build build --config=Release -- -v
47+
- name: install
48+
run: |
49+
cmake --install build --config=Release --prefix=.
50+
tar -acf arm64-linux-locc-${{ github.ref_name }}.tar.xz bin/locc-cli
51+
- name: release
52+
uses: softprops/action-gh-release@v2.3.4
53+
with:
54+
token: ${{ secrets.RELEASE_TOKEN }}
55+
files: arm64-linux-locc-${{ github.ref_name }}.tar.xz
56+
draft: true
57+
fail_on_unmatched_files: true
58+
x64-windows-clang:
59+
runs-on: windows-2025
60+
steps:
61+
- uses: actions/checkout@v4
62+
- name: configure
63+
run: cmake -S . --preset=ninja-clang -B build -DLOCC_BUILD_TESTS=OFF -DLOCC_BUILD_GUI=OFF
64+
- name: build release
65+
run: cmake --build build --config=Release -- -v
66+
- name: install
67+
run: |
68+
cmake --install build --config=Release --prefix=.
69+
tar -acf x64-windows-locc-${{ github.ref_name }}.zip bin/locc-cli.exe
70+
- name: release
71+
uses: softprops/action-gh-release@v2.3.4
72+
with:
73+
token: ${{ secrets.RELEASE_TOKEN }}
74+
files: x64-windows-locc-${{ github.ref_name }}.zip
75+
draft: true
76+
fail_on_unmatched_files: true

CMakeLists.txt

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,17 @@
11
cmake_minimum_required(VERSION 3.23)
22

3-
project(locc VERSION "0.4.0")
3+
project(locc VERSION "0.4.2")
44

55
set(CMAKE_CXX_STANDARD 23)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_CXX_EXTENSIONS OFF)
88
set(CMAKE_DEBUG_POSTFIX "-d")
99

10-
set(not_top_level ON)
11-
12-
if(${PROJECT_IS_TOP_LEVEL})
13-
set(not_top_level OFF)
14-
endif()
15-
16-
set(FETCHCONTENT_QUIET ${not_top_level})
17-
1810
option(LOCC_BUILD_CLI "Build locc CLI app" ${PROJECT_IS_TOP_LEVEL})
1911
option(LOCC_BUILD_GUI "Build locc GUI app" ${PROJECT_IS_TOP_LEVEL})
2012
option(LOCC_BUILD_TESTS "Build locc tests" ${PROJECT_IS_TOP_LEVEL})
2113

22-
add_library(${PROJECT_NAME}-compile-options INTERFACE)
23-
add_library(${PROJECT_NAME}::${PROJECT_NAME}-compile-options ALIAS ${PROJECT_NAME}-compile-options)
24-
25-
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang OR CMAKE_CXX_COMPILER_ID STREQUAL GNU)
26-
target_compile_options(${PROJECT_NAME}-compile-options INTERFACE
27-
-Wall -Wextra -Wpedantic -Wconversion -Werror=return-type
28-
)
29-
endif()
30-
31-
include(FetchContent)
32-
set(ext_dir "${CMAKE_CURRENT_SOURCE_DIR}/ext")
33-
set(fetch_targets "")
34-
35-
if(LOCC_BUILD_GUI AND NOT TARGET gvdi)
36-
FetchContent_Declare(gvdi
37-
GIT_REPOSITORY https://github.com/karnkaul/gvdi
38-
GIT_TAG v0.2.3
39-
GIT_SHALLOW TRUE
40-
SOURCE_DIR "${ext_dir}/src/gvdi"
41-
)
42-
list(APPEND fetch_targets gvdi)
43-
endif()
44-
45-
if(NOT TARGET djson)
46-
FetchContent_Declare(djson
47-
GIT_REPOSITORY https://github.com/karnkaul/djson
48-
GIT_TAG v2.1.2
49-
GIT_SHALLOW TRUE
50-
SOURCE_DIR "${ext_dir}/src/djson"
51-
)
52-
list(APPEND fetch_targets djson)
53-
endif()
54-
55-
if(NOT TARGET klib)
56-
FetchContent_Declare(klib
57-
GIT_REPOSITORY https://github.com/karnkaul/klib
58-
GIT_TAG v0.3.2
59-
GIT_SHALLOW TRUE
60-
SOURCE_DIR "${ext_dir}/src/klib"
61-
)
62-
list(APPEND fetch_targets klib)
63-
endif()
64-
65-
FetchContent_MakeAvailable(${fetch_targets})
66-
14+
add_subdirectory(ext)
6715
add_subdirectory(lib)
6816

6917
if(LOCC_BUILD_CLI)

0 commit comments

Comments
 (0)