Skip to content

Commit

Permalink
CI: Adding initial workflow (#4)
Browse files Browse the repository at this point in the history
* CI: Adding initial workflow

* Add required meson version

* Add temporary project version

* Use gnu2x for c_std instead of gnu23

* build.yml: Add more deps

* meson.build: Try to find installed sqlite{3,cpp}

For #6

* Use clang, reset c_std=gnu23, install bun

* Install clang-19

* Use "bun run meson-setup clang-release"

* Revert "Use "bun run meson-setup clang-release""

This reverts commit 79c9e22.

* Fix version

* remove blank line

* Add path filters

* Update build.yml

Attempt to add freeglut3-dev since this was also the issue when building the flatpak

* Update build.yml

Replaced vs.example with the actual meson command; 
otherwise, if successful, the machine would run the application without headless mode, and wait for user input.

* Update .github/workflows/build.yml

Co-authored-by: Andy Alt <[email protected]>

* Update build.yml

* Try to install cmake 3.30.5

For mesonbuild/meson#13888

* Install libpng-dev

* Update build.yml

Only keeping 24.04 for now, since the other versions ship with an older incompatible libc++

---------

Co-authored-by: KaruroChori <[email protected]>
  • Loading branch information
andy5995 and KaruroChori authored Nov 20, 2024
1 parent a54ba06 commit 51dc003
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 4 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: build and test
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

on:
push:
branches: [ master ]
paths:
- '**'
- '!**.yml'
- '!docs/**'
- '!**.md'
- '**/build.yml'
pull_request:
branches: [ master ]
paths:
- '**'
- '!**.yml'
- '!docs/**'
- '!**.md'
- '**/build.yml'

jobs:
meson:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
runs-on: ${{ matrix.os }}
env:
CC: clang-19
CXX: clang++-19
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
if [ "${{ contains(matrix.os, 'ubuntu') }}" = "true" ]; then
sudo apt update
curl -fsSL https://bun.sh/install | bash
echo "PATH=$HOME/.bun/bin:$PATH" >> $GITHUB_ENV
sudo apt update
sudo apt remove -y firefox
sudo apt upgrade -y
sudo apt install -y \
freeglut3-dev \
libpng-dev \
libsqlite3-0 \
python3-pip \
python3-setuptools
python3 -m pip install meson ninja
python3 -m pip uninstall cmake
python3 -m pip install cmake==3.30.5 # workaround https://github.com/mesonbuild/meson/issues/13888
# for clang
sudo apt install -y wget gpg gnupg software-properties-common
curl -LO https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19 # install clang-19
else
brew update
brew install meson ninja
fi
- name: Configure and build
run: |
cmake --version
bun install
bun run codegen
bun run meson-setup.clang-release
meson compile -C build/ vs:executable
27 changes: 23 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
project(
'vs-fltk',
['c', 'cpp', 'swift'],
version: 'v0.1.1-alpha-dev',
meson_version: '>= 1.1',
default_options: ['c_std=gnu23', 'cpp_std=gnu++23'],
)

cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')

#Used by pugi to enable compact mode. I might want to disable execptions too.
add_global_arguments(['-DPUGIXML_COMPACT'], language : ['cpp','c'])

Expand Down Expand Up @@ -87,10 +92,24 @@ libtcc_dep = libtcc_proj.get_variable('libtcc_dep')
mio_proj = cmake.subproject('mio')
mio_dep = mio_proj.dependency('mio')

#TODO convert to internald dep
sqlitecpp_dep = subproject('sqlitecpp').get_variable('sqlitecpp_dep')
sqlitecpp_dep = dependency('sqlitecpp', required: false)
if not sqlitecpp_dep.found()
sqlitecpp_dep = cxx.find_library('SQLiteCpp', required: false)
if not sqlitecpp_dep.found()
sqlitecpp_dep = dependency(
'sqlitecpp',
fallback: ['sqlitecpp', 'sqlitecpp_dep'],
default_options: 'default_library=static',
)
endif
endif

sqlite_dep = subproject('sqlite3').get_variable('sqlite3_dep')
sqlite_dep = dependency(
'sqlite3',
version: '>=3.0.0',
fallback: ['sqlite3', 'sqlite3_dep'],
default_options: 'default_library=static',
)

#TODO handle the case in which libcurl does not exist. Missing is fine, just no https/http prefix for paths.
curl = dependency('libcurl', required: false)
Expand Down Expand Up @@ -259,4 +278,4 @@ pconf.generate(
vs_fltk,
description: 'VS fltk library (C interface only)',
url: 'https://github.com/KaruroChori/vs-fltk/',
)
)

0 comments on commit 51dc003

Please sign in to comment.