Skip to content

Commit

Permalink
Merge branch 'master' of github.com:KaruroChori/vs-fltk
Browse files Browse the repository at this point in the history
  • Loading branch information
checkroom committed Nov 20, 2024
2 parents be3176e + a8cf511 commit 91c83eb
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 4 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
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/**'
- '!docker/**'
- '!**.md'
- '**/build.yml'
pull_request:
branches: [ master ]
paths:
- '**'
- '!**.yml'
- '!docs/**'
- '!docker/**'
- '!**.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 91c83eb

Please sign in to comment.