mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-08 03:36:06 -04:00
Merge pull request #407 Create Meson CI from ninjaoflight/patch-1
This commit is contained in:
commit
5222d2f828
80
.github/workflows/meson.yaml
vendored
Normal file
80
.github/workflows/meson.yaml
vendored
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
name: meson
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: (Meson) ${{ matrix.config.name }}
|
||||||
|
runs-on: ${{ matrix.config.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
- {
|
||||||
|
name: "Windows Latest MSVC",
|
||||||
|
os: windows-latest,
|
||||||
|
cc: "cl", cxx: "cl",
|
||||||
|
extra_path: "",
|
||||||
|
requires_msvc: true,
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
name: "Windows Latest MinGW",
|
||||||
|
os: windows-latest,
|
||||||
|
cc: "gcc", cxx: "g++",
|
||||||
|
extra_path: "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin",
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
name: "Windows Latest Clang",
|
||||||
|
os: windows-latest,
|
||||||
|
cc: "clang", cxx: "clang++", c_ld: "lld-link", cxx_ld: "lld-link",
|
||||||
|
extra_path: "",
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
name: "Ubuntu Latest GCC",
|
||||||
|
os: ubuntu-latest,
|
||||||
|
cc: "gcc", cxx: "g++",
|
||||||
|
extra_path: ""
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
name: "Ubuntu Latest Clang",
|
||||||
|
os: ubuntu-latest,
|
||||||
|
cc: "clang", cxx: "clang++", c_ld: "lld", cxx_ld: "lld",
|
||||||
|
extra_path: ""
|
||||||
|
}
|
||||||
|
- {
|
||||||
|
name: "macOS Latest Clang",
|
||||||
|
os: macos-latest,
|
||||||
|
cc: "clang", cxx: "clang++",
|
||||||
|
extra_path: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
# use msvc-dev-cmd to setup the environment for MSVC if needed
|
||||||
|
- name: setup MSVC
|
||||||
|
if: matrix.config.requires_msvc
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
- name: extra_path
|
||||||
|
shell: bash
|
||||||
|
run: echo "${{matrix.config.extra_path}}" >> $GITHUB_PATH
|
||||||
|
- name: install prerequisites
|
||||||
|
run: |
|
||||||
|
# asuming that python and pip are already installed
|
||||||
|
pip3 install meson ninja
|
||||||
|
- name: setup meson project
|
||||||
|
env: # set proper compilers and linkers for meson
|
||||||
|
CC: ${{matrix.config.cc}}
|
||||||
|
CXX: ${{matrix.config.cxx}}
|
||||||
|
C_LD: ${{matrix.config.c_ld}}
|
||||||
|
CXX_LD: ${{matrix.config.cxx_ld}}
|
||||||
|
run: |
|
||||||
|
# setup the build directory with tests and examples enabled
|
||||||
|
meson setup builddir -DSQLITECPP_BUILD_TESTS=true -DSQLITECPP_BUILD_EXAMPLES=true --force-fallback-for=sqlite3
|
||||||
|
- name: build meson project
|
||||||
|
run: |
|
||||||
|
# build the project
|
||||||
|
meson compile -C builddir
|
||||||
|
- name: test
|
||||||
|
run: |
|
||||||
|
# run the tests
|
||||||
|
meson test -C builddir
|
@ -159,6 +159,9 @@ if get_option('SQLITE_OMIT_LOAD_EXTENSION')
|
|||||||
sqlitecpp_args += ['-DSQLITE_OMIT_LOAD_EXTENSION']
|
sqlitecpp_args += ['-DSQLITE_OMIT_LOAD_EXTENSION']
|
||||||
## check if running on OSX
|
## check if running on OSX
|
||||||
elif host_machine.system() == 'darwin' and sqlite3_dep.found()
|
elif host_machine.system() == 'darwin' and sqlite3_dep.found()
|
||||||
|
## check if sqlite3 is the one bundled with OSX
|
||||||
|
if sqlite3_dep.type_name() != 'internal'
|
||||||
|
message('warning: Detected non-internal SQLite3 in OSX, check if it supports load extension')
|
||||||
sqlite3_load_extension_support = cxx.links(
|
sqlite3_load_extension_support = cxx.links(
|
||||||
'''
|
'''
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
@ -176,6 +179,7 @@ elif host_machine.system() == 'darwin' and sqlite3_dep.found()
|
|||||||
sqlitecpp_args += ['-DSQLITE_OMIT_LOAD_EXTENSION']
|
sqlitecpp_args += ['-DSQLITE_OMIT_LOAD_EXTENSION']
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user