Merged with master

This commit is contained in:
Pierre Proske 2023-03-06 19:01:20 +11:00
commit b736d0a759
6 changed files with 386 additions and 296 deletions

View File

@ -44,7 +44,7 @@ jobs:
} }
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: submodule - name: submodule
run: git submodule update --init --recursive run: git submodule update --init --recursive
- name: extra_path - name: extra_path

80
.github/workflows/meson.yaml vendored Normal file
View 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

View File

@ -27,7 +27,7 @@ jobs:
} }
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: configure - name: configure
shell: cmake -P {0} shell: cmake -P {0}
run: | run: |

View File

@ -6,7 +6,7 @@ example2_srcs = files(
example2_args = [] example2_args = []
sqlitecpp_demo2_exe = executable('SQLITECPP_sample_demo1', sqlitecpp_demo2_exe = executable('SQLITECPP_sample_demo2',
sqlitecpp_sample2_srcs, sqlitecpp_sample2_srcs,
dependencies: sqlitecpp_dep, dependencies: sqlitecpp_dep,
# inherit the default options from sqlitecpp # inherit the default options from sqlitecpp

View File

@ -65,6 +65,7 @@ sqlitecpp_deps = [
] ]
## used to override the default sqlitecpp options like cpp standard ## used to override the default sqlitecpp options like cpp standard
sqlitecpp_opts = [] sqlitecpp_opts = []
## used to set required macros when using sqlitecpp ## used to set required macros when using sqlitecpp
sqlitecpp_dep_args = [] sqlitecpp_dep_args = []
@ -156,6 +157,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>
@ -173,6 +177,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
@ -198,6 +203,7 @@ endif
sqlitecpp_static_args = sqlitecpp_args sqlitecpp_static_args = sqlitecpp_args
sqlitecpp_static_dep_args = sqlitecpp_dep_args sqlitecpp_static_dep_args = sqlitecpp_dep_args
# if windows and shared library # if windows and shared library
if host_machine.system() == 'windows' and get_option('default_library') == 'shared' if host_machine.system() == 'windows' and get_option('default_library') == 'shared'
# compile with SQLITECPP_COMPILE_DLL and SQLITECPP_DLL_EXPORT=1 # compile with SQLITECPP_COMPILE_DLL and SQLITECPP_DLL_EXPORT=1
@ -211,6 +217,7 @@ if host_machine.system() == 'windows' and get_option('default_library') == 'shar
] ]
endif endif
libsqlitecpp = library( libsqlitecpp = library(
'sqlitecpp', 'sqlitecpp',
sqlitecpp_srcs, sqlitecpp_srcs,
@ -223,6 +230,8 @@ libsqlitecpp = library(
# API version for SQLiteCpp shared library. # API version for SQLiteCpp shared library.
version: '0',) version: '0',)
if get_option('SQLITECPP_BUILD_TESTS') if get_option('SQLITECPP_BUILD_TESTS')
# for the unit tests we need to link against a static version of SQLiteCpp # for the unit tests we need to link against a static version of SQLiteCpp
if get_option('default_library') == 'static' if get_option('default_library') == 'static'
@ -251,6 +260,7 @@ sqlitecpp_dep = declare_dependency(
) )
if get_option('SQLITECPP_BUILD_TESTS') if get_option('SQLITECPP_BUILD_TESTS')
## make the dependency static so the unit tests can link against it ## make the dependency static so the unit tests can link against it
## (mainly for windows as the symbols are not exported by default)
sqlitecpp_static_dep = declare_dependency( sqlitecpp_static_dep = declare_dependency(
include_directories: sqlitecpp_incl, include_directories: sqlitecpp_incl,
link_with: libsqlitecpp_static, link_with: libsqlitecpp_static,

View File

@ -1,7 +1,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3"> <package format="3">
<name>SQLiteCpp</name> <name>SQLiteCpp</name>
<version>3.1.1</version> <version>3.2.1</version>
<description>A smart and easy to use C++ SQLite3 wrapper.</description> <description>A smart and easy to use C++ SQLite3 wrapper.</description>
<maintainer email="sebastien.rombauts@gmail.com">Sébastien Rombauts</maintainer> <maintainer email="sebastien.rombauts@gmail.com">Sébastien Rombauts</maintainer>