Skip to content

Commit ca72d77

Browse files
committed
Enabled C++20 if it is available (if it is not, CMake will choose an earlier version)
1 parent 1abe7b0 commit ca72d77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ target_include_directories(SQLiteCpp PRIVATE
196196
)
197197
target_link_libraries(SQLiteCpp PUBLIC sqlite3)
198198
harden(SQLiteCpp)
199+
set_property(TARGET SQLiteCpp PROPERTY CXX_STANDARD 20)
199200

200201
if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
201202
set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-fPIC")
@@ -275,6 +276,7 @@ if (SQLITECPP_BUILD_EXAMPLES)
275276
# add the basic example executable
276277
add_executable(SQLiteCpp_example1 ${SQLITECPP_EXAMPLES})
277278
target_link_libraries(SQLiteCpp_example1 SQLiteCpp)
279+
set_property(TARGET SQLiteCpp_example1 PROPERTY CXX_STANDARD 20)
278280
harden(SQLiteCpp_example1)
279281

280282
# Link target with pthread and dl for linux
@@ -327,7 +329,7 @@ if (SQLITECPP_BUILD_TESTS)
327329
target_include_directories(SQLiteCpp_tests PRIVATE "${GTEST_INCLUDE_DIR}" "${sqlite3_AMALGAMATION_SOURCE_DIR}")
328330
target_link_libraries(SQLiteCpp_tests "${GTEST_LIBRARY}" "${GTEST_MAIN_LIBRARY}" SQLiteCpp sqlite3)
329331
harden(SQLiteCpp_tests)
330-
332+
set_property(TARGET SQLiteCpp_tests PROPERTY CXX_STANDARD 20)
331333
# Link target with dl for linux
332334
if (UNIX AND NOT APPLE)
333335
target_link_libraries(SQLiteCpp_tests dl)

0 commit comments

Comments
 (0)