UnitTests: Use Sqlite library

Because the unit tests are not self contained anymore we can use the
Sqlite library from the creator build.

Change-Id: I89dde09e6fcfb8dda002b6e2bf11528a0933cde7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2022-06-21 13:26:11 +02:00
parent c1a223549b
commit 220267638f

View File

@@ -24,7 +24,7 @@ add_qtc_test(unittest GTEST
DEPENDS DEPENDS
Qt5::Core Qt5::Network Qt5::Widgets Qt5::Core Qt5::Network Qt5::Widgets
Qt5::Xml Qt5::Concurrent Qt5::Qml Qt5::Gui Qt5::Xml Qt5::Concurrent Qt5::Qml Qt5::Gui
Qt6Core5Compat QmlJS Qt6Core5Compat QmlJS Sqlite
Googletest Googletest
CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0 CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0
DEFINES DEFINES
@@ -122,19 +122,6 @@ function(extend_qtc_test_with_target_sources target)
) )
endfunction() endfunction()
if (NOT TARGET Sqlite)
add_subdirectory(../../../src/libs/sqlite ${CMAKE_CURRENT_BINARY_DIR}/sqlite)
endif()
extend_qtc_test_with_target_sources(Sqlite
DEFINES SQLITE_CUSTOM_INCLUDE=config.h SQLITE_STATIC_LIBRARY
)
if (APPLE)
extend_qtc_test(unittest DEFINES _BSD_SOURCE)
elseif (UNIX)
extend_qtc_test(unittest DEFINES _POSIX_C_SOURCE=200809L _GNU_SOURCE _DEFAULT_SOURCE)
endif()
# Do not work on the source directory data # Do not work on the source directory data
add_custom_command(TARGET unittest POST_BUILD add_custom_command(TARGET unittest POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory COMMAND "${CMAKE_COMMAND}" -E copy_directory