Skip to content

Commit 2a88ed3

Browse files
authored
tests: fix static link order (#478)
### What's done Place the driver target before `CASS_LIBS` in `target_link_libraries` for integration tests. With static linking the linker resolves symbols left-to-right, so the archive providing symbols must precede the libraries that define them. It's fascinating that the bug comes from the DataStax CPP Driver's build system. They must have never tested static linkage with integration tests. ### Verification ```sh cmake\ -DCASS_BUILD_INTEGRATION_TESTS=ON \ -DCASS_USE_STATIC_LIBS=ON \ -B build \ && (cd build && make) ``` now works. Before, it would fails with undefined references to OpenSSL symbols. ### Further work #438 apart of containing this fix, introduced **a lot** of changes and static linkage verification using the smoke test app. I'm working on making the changes more granular, better documented, and hence mergable. Fixes: #164
2 parents ead94af + 2a9ca24 commit 2a88ed3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/src/integration/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ target_include_directories(cassandra-integration-tests PRIVATE
6262
${CASS_INCLUDES})
6363

6464
target_link_libraries(cassandra-integration-tests
65-
${CASS_LIBS}
6665
${PROJECT_LIB_NAME_TARGET}
66+
${CASS_LIBS}
6767
${INTEGRATION_TESTS_LIBSSH2_LIBRARIES})
6868

6969
set_target_properties(cassandra-integration-tests PROPERTIES

0 commit comments

Comments
 (0)