2021-08-02 03:49:16 +08:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
macro(build_and_run arg)
|
|
|
|
add_executable(Sqlpp11MySQL${arg} ${arg}.cpp)
|
|
|
|
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE sqlpp-mysql)
|
|
|
|
target_link_libraries(Sqlpp11MySQL${arg} PRIVATE Threads::Threads)
|
|
|
|
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)
|