2021-08-02 03:49:16 +08:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
macro(build_and_run arg)
|
2021-08-15 22:17:35 +08:00
|
|
|
add_executable(Sqlpp11MySQL${arg} ${arg}.cpp)
|
2021-08-02 03:49:16 +08:00
|
|
|
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE Threads::Threads)
|
2021-08-15 22:17:35 +08:00
|
|
|
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE sqlpp11::sqlpp11)
|
|
|
|
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE MySQL::MySQL)
|
|
|
|
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE date::date)
|
2021-08-02 03:49:16 +08:00
|
|
|
if(${arg} STREQUAL "JsonTest")
|
|
|
|
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE MySQL::MySQL)
|
|
|
|
endif()
|
|
|
|
if(NOT MSVC)
|
|
|
|
target_compile_options(Sqlpp11MySQL${arg} PRIVATE -Wall -Wextra -pedantic)
|
|
|
|
endif()
|
|
|
|
add_test(${arg} Sqlpp11MySQL${arg})
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
build_and_run(JsonTest)
|
|
|
|
build_and_run(CustomQuery)
|
|
|
|
build_and_run(DateTimeTest)
|
|
|
|
build_and_run(SampleTest)
|
|
|
|
build_and_run(SelectTest)
|
|
|
|
build_and_run(UnionTest)
|
|
|
|
build_and_run(DynamicSelectTest)
|
|
|
|
build_and_run(MoveConstructorTest)
|
|
|
|
build_and_run(PreparedTest)
|
|
|
|
build_and_run(TruncatedTest)
|
2021-08-14 16:49:18 +08:00
|
|
|
build_and_run(UpdateTest)
|
|
|
|
build_and_run(RemoveTest)
|