Commit e2f1ca53 authored by Vadim Zeitlin's avatar Vadim Zeitlin

Fix libraries link order when linking tests statically

Link with the backend (static) library first, then with the core
library in order to ensure that the backend library can use functions
defined in the core library even if they are not used by the core
library itself: previously, such functions would be discarded by a
traditional Unix linker when processing the core library because they
wouldn't be referenced and then be missing, resulting in link errors,
when it processes the backend library.

This will allow sharing some code between the backends in the upcoming
commit.
parent 48882507
......@@ -373,8 +373,8 @@ macro(soci_backend_test)
target_link_libraries(${TEST_TARGET_STATIC}
${SOCI_CORE_DEPS_LIBS}
${THIS_TEST_DEPENDS_LIBRARIES}
soci_core_static
soci_${BACKENDL}_static)
soci_${BACKENDL}_static
soci_core_static)
add_test(${TEST_TARGET_STATIC}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TARGET_STATIC}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment