Skip to content

Commit 1a3d518

Browse files
committed
Trying to compile a test file that consumes sqlite_orm as a named module
1 parent a006f62 commit 1a3d518

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ set(PACKAGE_VERSION ${sqlite_orm_VERSION})
1111
project("sqlite_orm" VERSION ${PACKAGE_VERSION})
1212

1313
# Handling C++ standard version to use
14+
option(SQLITE_ORM_ENABLE_CXX_23 "Enable C++ 23" OFF)
1415
option(SQLITE_ORM_ENABLE_CXX_20 "Enable C++ 20" OFF)
1516
option(SQLITE_ORM_ENABLE_CXX_17 "Enable C++ 17" OFF)
1617
set(CMAKE_CXX_STANDARD_REQUIRED ON)
17-
if(SQLITE_ORM_ENABLE_CXX_20)
18+
if(SQLITE_ORM_ENABLE_CXX_23)
19+
set(CMAKE_CXX_STANDARD 23)
20+
message(STATUS "SQLITE_ORM: Build with C++23 features")
21+
elseif(SQLITE_ORM_ENABLE_CXX_20)
1822
set(CMAKE_CXX_STANDARD 20)
1923
message(STATUS "SQLITE_ORM: Build with C++20 features")
2024
elseif(SQLITE_ORM_ENABLE_CXX_17)

appveyor.yml

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ configuration:
2020
environment:
2121
appveyor_yml_disable_ps_linux: true
2222
matrix:
23+
- job_name: Visual Studio 2022, x64, C++23
24+
appveyor_build_worker_image: Visual Studio 2022
25+
platform: x64
26+
SQLITE_ORM_CXX_STANDARD: "-DSQLITE_ORM_ENABLE_CXX_23=ON"
27+
2328
- job_name: clang, C++14
2429
appveyor_build_worker_image: Ubuntu
2530
CC: clang

tests/CMakeLists.txt

+27
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ FetchContent_MakeAvailable(Catch2)
55

66
option(SQLITE_ORM_OMITS_CODECVT "Omits codec testing" OFF)
77

8+
9+
if(SQLITE_ORM_ENABLE_CXX_23 AND CMAKE_VERSION GREATER_EQUAL 3.28.2 AND MSVC and MSVC_VERSION GREATER_EQUAL 1930)
10+
add_executable(module_tests
11+
named_module.cpp
12+
)
13+
14+
target_sources(module_tests PUBLIC
15+
FILE_SET all_my_modules TYPE CXX_MODULES FILES
16+
../modules/sqlite_orm.ixx
17+
)
18+
19+
target_compile_features(module_tests PUBLIC cxx_std_23)
20+
21+
if(SQLITE_ORM_OMITS_CODECVT)
22+
message(STATUS "SQLITE_ORM_OMITS_CODECVT is enabled")
23+
target_compile_definitions(module_tests PRIVATE SQLITE_ORM_OMITS_CODECVT=1)
24+
endif()
25+
26+
target_precompile_headers(module_tests PRIVATE
27+
<sqlite3.h>)
28+
29+
add_test(NAME "module_tests"
30+
COMMAND module_tests
31+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
32+
endif()
33+
34+
835
add_executable(unit_tests
936
static_tests/functional/static_if_tests.cpp
1037
static_tests/functional/mpl.cpp

tests/named_module.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import sqlite_orm;
2+
3+
int main() {}

0 commit comments

Comments
 (0)