Skip to content

Commit ff7c878

Browse files
authored
Merge pull request #1158 from FireDaemon/1.8.2-to-master
1.8.2
2 parents f4af812 + e041fb4 commit ff7c878

File tree

121 files changed

+4545
-3717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+4545
-3717
lines changed

CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
cmake_minimum_required (VERSION 3.14.0)
1+
# note: the minimum required version needs to go hand in hand with appveyor builds,
2+
# which is CMake 3.16 for the Visual Studio 2017 build worker image
3+
cmake_minimum_required (VERSION 3.16)
24

35
# PACKAGE_VERSION is used by cpack scripts currently
46
# Both sqlite_orm_VERSION and PACKAGE_VERSION should be the same for now
@@ -59,6 +61,10 @@ if (MSVC)
5961
if (MSVC_VERSION GREATER_EQUAL 1914)
6062
add_compile_options(/Zc:__cplusplus)
6163
endif()
64+
if (MSVC_VERSION GREATER_EQUAL 1910)
65+
# VC 2017 issues a deprecation warning for `strncpy`
66+
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
67+
endif()
6268
add_compile_options(/MP) # multi-processor compilation
6369
if (CMAKE_CXX_STANDARD GREATER 14)
6470
add_compile_definitions(_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
@@ -78,7 +84,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
7884
add_subdirectory(tests)
7985
endif()
8086

81-
option(BUILD_EXAMPLES ON)
87+
option(BUILD_EXAMPLES "Build code examples" OFF)
8288
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_EXAMPLES)
8389
add_subdirectory(examples)
8490
endif()

appveyor.yml

+31-17
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ environment:
2525
CC: clang
2626
CXX: clang++
2727
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_14=ON"
28+
cmake_build_parallel: --parallel
2829

2930
- job_name: gcc, C++14
3031
appveyor_build_worker_image: Ubuntu
3132
CC: gcc
3233
CXX: g++
3334
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_14=ON"
35+
# gcc was stuck with a parallel build
36+
cmake_build_parallel: ""
3437

3538
# Representative for C++14
36-
- job_name: Visual Studio 2022, x64, C++14
37-
appveyor_build_worker_image: Visual Studio 2022
39+
- job_name: Visual Studio 2017, x64, C++14
40+
appveyor_build_worker_image: Visual Studio 2017
3841
platform: x64
3942
SQLITE_ORM_CXX_STANDARD: ""
4043

@@ -43,24 +46,30 @@ environment:
4346
CC: clang
4447
CXX: clang++
4548
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_17=ON"
46-
47-
- job_name: clang, C++20
48-
appveyor_build_worker_image: Ubuntu
49-
CC: clang
50-
CXX: clang++
51-
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_20=ON"
49+
cmake_build_parallel: --parallel
5250

5351
- job_name: gcc, C++17
5452
appveyor_build_worker_image: Ubuntu
5553
CC: gcc
5654
CXX: g++
5755
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_17=ON"
56+
cmake_build_parallel: ""
57+
58+
- job_name: clang, C++20 (with examples)
59+
appveyor_build_worker_image: Ubuntu
60+
CC: clang
61+
CXX: clang++
62+
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_20=ON"
63+
# clang was stuck with a parallel build of examples
64+
cmake_build_parallel: ""
65+
cmake_build_examples: "-DBUILD_EXAMPLES=ON"
5866

5967
- job_name: gcc, C++20
6068
appveyor_build_worker_image: Ubuntu
6169
CC: gcc
6270
CXX: g++
6371
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_20=ON"
72+
cmake_build_parallel: ""
6473

6574
- job_name: Visual Studio 2022, x64, C++17
6675
appveyor_build_worker_image: Visual Studio 2022
@@ -85,15 +94,16 @@ for:
8594
# Windows
8695
matrix:
8796
only:
88-
- appveyor_build_worker_image: Visual Studio 2015
97+
- appveyor_build_worker_image: Visual Studio 2017
8998
- appveyor_build_worker_image: Visual Studio 2022
9099
init:
91100
- |-
92101
echo %appveyor_build_worker_image% - %platform% - %configuration%
102+
cmake --version
93103
if "%platform%"=="x64" (set architecture=-A x64)
94104
if "%platform%"=="x86" (set architecture=-A Win32)
95105
if "%appveyor_build_worker_image%"=="Visual Studio 2022" (set generator="Visual Studio 17 2022" %architecture%)
96-
if "%appveyor_build_worker_image%"=="Visual Studio 2015" (set generator="Visual Studio 14 2015" %architecture%)
106+
if "%appveyor_build_worker_image%"=="Visual Studio 2017" (set generator="Visual Studio 15 2017" %architecture%)
97107
install:
98108
- |-
99109
cd C:\Tools\vcpkg
@@ -102,16 +112,18 @@ for:
102112
C:\Tools\vcpkg\bootstrap-vcpkg.bat -disableMetrics
103113
C:\Tools\vcpkg\vcpkg integrate install
104114
set VCPKG_DEFAULT_TRIPLET=%platform%-windows
105-
vcpkg install sqlite3 catch2
115+
vcpkg install sqlite3
116+
rem The Visual Studio 2017 build worker image comes with CMake 3.16 only, and sqlite_orm will build the Catch2 dependency from source
117+
if not "%appveyor_build_worker_image%"=="Visual Studio 2017" (vcpkg install catch2)
106118
before_build:
107119
- |-
108120
mkdir compile
109121
cd compile
110-
cmake %SQLITE_ORM_CXX_STANDARD% .. -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
122+
cmake %SQLITE_ORM_CXX_STANDARD% -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..
111123
# build examples, and run tests (ie make & make test)
112124
build_script:
113125
- |-
114-
cmake --build . --config %configuration%
126+
cmake --build . --config %configuration% -- /m
115127
ctest --verbose --output-on-failure --build-config %configuration%
116128
117129
-
@@ -123,6 +135,7 @@ for:
123135
- |-
124136
echo $appveyor_build_worker_image
125137
$CXX --version
138+
cmake --version
126139
# using custom vcpkg triplets for building and linking dynamic dependent libraries
127140
install:
128141
- |-
@@ -136,11 +149,11 @@ for:
136149
- |-
137150
mkdir compile
138151
cd compile
139-
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
152+
cmake $SQLITE_ORM_CXX_STANDARD $cmake_build_examples --toolchain $HOME/vcpkg/scripts/buildsystems/vcpkg.cmake ..
140153
# build examples, and run tests (ie make & make test)
141154
build_script:
142155
- |-
143-
cmake --build .
156+
cmake --build . $cmake_build_parallel
144157
ctest --verbose --output-on-failure
145158
-
146159
# macOS
@@ -151,6 +164,7 @@ for:
151164
- |-
152165
echo $appveyor_build_worker_image
153166
$CXX --version
167+
cmake --version
154168
# using custom vcpkg triplets for building and linking dynamic dependent libraries
155169
install:
156170
- |-
@@ -162,9 +176,9 @@ for:
162176
- |-
163177
mkdir compile
164178
cd compile
165-
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
179+
cmake $SQLITE_ORM_CXX_STANDARD --toolchain $HOME/vcpkg/scripts/buildsystems/vcpkg.cmake ..
166180
# build examples, and run tests (ie make & make test)
167181
build_script:
168182
- |-
169-
cmake --build .
183+
cmake --build . --parallel
170184
ctest --verbose --output-on-failure

dependencies/CMakeLists.txt

+23-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
include(FetchContent)
22

33
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
4-
FetchContent_Declare(
5-
Catch2
6-
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
7-
GIT_TAG v3.2.1
8-
)
9-
add_subdirectory(catch2)
4+
# FIND_PACKAGE_ARGS is available since 3.24
5+
if(CMAKE_VERSION VERSION_LESS 3.24)
6+
FetchContent_Declare(
7+
Catch2
8+
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
9+
GIT_TAG v3.2.1
10+
)
11+
else()
12+
FetchContent_Declare(
13+
Catch2
14+
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
15+
GIT_TAG v3.2.1
16+
# prefer find_package() over building from source
17+
FIND_PACKAGE_ARGS 3 CONFIG
18+
)
19+
endif()
1020
endif()
1121

12-
add_subdirectory(sqlite3)
22+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
23+
# CMake <3.24: exposes targets only locally, but caches them. So call FetchContent_MakeAvailable again in the directory of usage
24+
FetchContent_MakeAvailable(Catch2)
25+
endif()
26+
27+
# CMake <3.24: exposes targets only locally, but caches them. So call find_package again in the directory of usage
28+
find_package(SQLite3 REQUIRED)

dependencies/catch2/CMakeLists.txt

-1
This file was deleted.

dependencies/sqlite3/CMakeLists.txt

-2
This file was deleted.

0 commit comments

Comments
 (0)