CMake: Use the correct jsoncpp target name in static builds

When building protobuf with BUILD_SHARED_LIBS disabled,
conformance_test_runner should link jsoncpp_static but not jsoncpp_lib.
pull/12733/head
Alexey Edelev 2 years ago
parent c78b0f10b7
commit 2ab4be6bb0
  1. 6
      cmake/conformance.cmake

@ -90,7 +90,11 @@ set(JSONCPP_WITH_TESTS OFF CACHE BOOL "Disable tests")
if(protobuf_JSONCPP_PROVIDER STREQUAL "module")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/jsoncpp third_party/jsoncpp)
target_include_directories(conformance_test_runner PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/jsoncpp/include)
target_link_libraries(conformance_test_runner jsoncpp_lib)
if(BUILD_SHARED_LIBS)
target_link_libraries(conformance_test_runner jsoncpp_lib)
else()
target_link_libraries(conformance_test_runner jsoncpp_static)
endif()
else()
target_link_libraries(conformance_test_runner jsoncpp)
endif()

Loading…
Cancel
Save