Skip to content

Commit

Permalink
Merge pull request #1158 from FireDaemon/1.8.2-to-master
Browse files Browse the repository at this point in the history
1.8.2
  • Loading branch information
fnc12 authored Mar 24, 2023
2 parents f4af812 + e041fb4 commit ff7c878
Show file tree
Hide file tree
Showing 121 changed files with 4,545 additions and 3,717 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cmake_minimum_required (VERSION 3.14.0)
# note: the minimum required version needs to go hand in hand with appveyor builds,
# which is CMake 3.16 for the Visual Studio 2017 build worker image
cmake_minimum_required (VERSION 3.16)

# PACKAGE_VERSION is used by cpack scripts currently
# Both sqlite_orm_VERSION and PACKAGE_VERSION should be the same for now
Expand Down Expand Up @@ -59,6 +61,10 @@ if (MSVC)
if (MSVC_VERSION GREATER_EQUAL 1914)
add_compile_options(/Zc:__cplusplus)
endif()
if (MSVC_VERSION GREATER_EQUAL 1910)
# VC 2017 issues a deprecation warning for `strncpy`
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
add_compile_options(/MP) # multi-processor compilation
if (CMAKE_CXX_STANDARD GREATER 14)
add_compile_definitions(_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
Expand All @@ -78,7 +84,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(tests)
endif()

option(BUILD_EXAMPLES ON)
option(BUILD_EXAMPLES "Build code examples" OFF)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
Expand Down
48 changes: 31 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ environment:
CC: clang
CXX: clang++
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_14=ON"
cmake_build_parallel: --parallel

- job_name: gcc, C++14
appveyor_build_worker_image: Ubuntu
CC: gcc
CXX: g++
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_14=ON"
# gcc was stuck with a parallel build
cmake_build_parallel: ""

# Representative for C++14
- job_name: Visual Studio 2022, x64, C++14
appveyor_build_worker_image: Visual Studio 2022
- job_name: Visual Studio 2017, x64, C++14
appveyor_build_worker_image: Visual Studio 2017
platform: x64
SQLITE_ORM_CXX_STANDARD: ""

Expand All @@ -43,24 +46,30 @@ environment:
CC: clang
CXX: clang++
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_17=ON"

- job_name: clang, C++20
appveyor_build_worker_image: Ubuntu
CC: clang
CXX: clang++
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_20=ON"
cmake_build_parallel: --parallel

- job_name: gcc, C++17
appveyor_build_worker_image: Ubuntu
CC: gcc
CXX: g++
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_17=ON"
cmake_build_parallel: ""

- job_name: clang, C++20 (with examples)
appveyor_build_worker_image: Ubuntu
CC: clang
CXX: clang++
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_20=ON"
# clang was stuck with a parallel build of examples
cmake_build_parallel: ""
cmake_build_examples: "-DBUILD_EXAMPLES=ON"

- job_name: gcc, C++20
appveyor_build_worker_image: Ubuntu
CC: gcc
CXX: g++
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_20=ON"
cmake_build_parallel: ""

- job_name: Visual Studio 2022, x64, C++17
appveyor_build_worker_image: Visual Studio 2022
Expand All @@ -85,15 +94,16 @@ for:
# Windows
matrix:
only:
- appveyor_build_worker_image: Visual Studio 2015
- appveyor_build_worker_image: Visual Studio 2017
- appveyor_build_worker_image: Visual Studio 2022
init:
- |-
echo %appveyor_build_worker_image% - %platform% - %configuration%
cmake --version
if "%platform%"=="x64" (set architecture=-A x64)
if "%platform%"=="x86" (set architecture=-A Win32)
if "%appveyor_build_worker_image%"=="Visual Studio 2022" (set generator="Visual Studio 17 2022" %architecture%)
if "%appveyor_build_worker_image%"=="Visual Studio 2015" (set generator="Visual Studio 14 2015" %architecture%)
if "%appveyor_build_worker_image%"=="Visual Studio 2017" (set generator="Visual Studio 15 2017" %architecture%)
install:
- |-
cd C:\Tools\vcpkg
Expand All @@ -102,16 +112,18 @@ for:
C:\Tools\vcpkg\bootstrap-vcpkg.bat -disableMetrics
C:\Tools\vcpkg\vcpkg integrate install
set VCPKG_DEFAULT_TRIPLET=%platform%-windows
vcpkg install sqlite3 catch2
vcpkg install sqlite3
rem The Visual Studio 2017 build worker image comes with CMake 3.16 only, and sqlite_orm will build the Catch2 dependency from source
if not "%appveyor_build_worker_image%"=="Visual Studio 2017" (vcpkg install catch2)
before_build:
- |-
mkdir compile
cd compile
cmake %SQLITE_ORM_CXX_STANDARD% .. -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake %SQLITE_ORM_CXX_STANDARD% -G %generator% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..
# build examples, and run tests (ie make & make test)
build_script:
- |-
cmake --build . --config %configuration%
cmake --build . --config %configuration% -- /m
ctest --verbose --output-on-failure --build-config %configuration%
-
Expand All @@ -123,6 +135,7 @@ for:
- |-
echo $appveyor_build_worker_image
$CXX --version
cmake --version
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
Expand All @@ -136,11 +149,11 @@ for:
- |-
mkdir compile
cd compile
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake $SQLITE_ORM_CXX_STANDARD $cmake_build_examples --toolchain $HOME/vcpkg/scripts/buildsystems/vcpkg.cmake ..
# build examples, and run tests (ie make & make test)
build_script:
- |-
cmake --build .
cmake --build . $cmake_build_parallel
ctest --verbose --output-on-failure
-
# macOS
Expand All @@ -151,6 +164,7 @@ for:
- |-
echo $appveyor_build_worker_image
$CXX --version
cmake --version
# using custom vcpkg triplets for building and linking dynamic dependent libraries
install:
- |-
Expand All @@ -162,9 +176,9 @@ for:
- |-
mkdir compile
cd compile
cmake $SQLITE_ORM_CXX_STANDARD .. -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake $SQLITE_ORM_CXX_STANDARD --toolchain $HOME/vcpkg/scripts/buildsystems/vcpkg.cmake ..
# build examples, and run tests (ie make & make test)
build_script:
- |-
cmake --build .
cmake --build . --parallel
ctest --verbose --output-on-failure
30 changes: 23 additions & 7 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
include(FetchContent)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.2.1
)
add_subdirectory(catch2)
# FIND_PACKAGE_ARGS is available since 3.24
if(CMAKE_VERSION VERSION_LESS 3.24)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.2.1
)
else()
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.2.1
# prefer find_package() over building from source
FIND_PACKAGE_ARGS 3 CONFIG
)
endif()
endif()

add_subdirectory(sqlite3)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
# CMake <3.24: exposes targets only locally, but caches them. So call FetchContent_MakeAvailable again in the directory of usage
FetchContent_MakeAvailable(Catch2)
endif()

# CMake <3.24: exposes targets only locally, but caches them. So call find_package again in the directory of usage
find_package(SQLite3 REQUIRED)
1 change: 0 additions & 1 deletion dependencies/catch2/CMakeLists.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dependencies/sqlite3/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit ff7c878

Please sign in to comment.