Skip to content
Snippets Groups Projects
Commit 8221876d authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

FIX: Linker errors in tests on Windows

Adding the grpc-generated sources to the executable of each test fixes
the protobuf-related linker errors on Windows.
parent 9d7dbcc0
No related branches found
No related tags found
2 merge requests!61Release 0.3.0,!54Resolve "Windows: Linker errors with protobuf-generated code"
Pipeline #54623 failed
......@@ -61,13 +61,13 @@ list(LENGTH test_cases len_test_cases)
math(EXPR len_test_cases "${len_test_cases} - 1")
foreach (i RANGE "${len_test_cases}")
list(GET test_cases ${i} test_case_name)
add_executable(${test_case_name} ${test_case_name}.cpp)
add_executable(${test_case_name} ${test_case_name}.cpp ${GRPC_GENERATED})
set(libcaosdb_TEST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${test_case_name}.cpp
${libcaosdb_TEST_SRC}")
target_link_libraries(${test_case_name}
PRIVATE GTest::gtest_main caosdb ccaosdb gtest::gtest)
target_include_directories(${test_case_name}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR})
if(_LINTING)
message(STATUS "linting for tests: ${_CMAKE_CXX_INCLUDE_WHAT_YOU_USE}")
set_target_properties(${test_case_name}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment