Skip to content

Commit

Permalink
CMake: Use the correct jsoncpp target name in static builds (protocol…
Browse files Browse the repository at this point in the history
…buffers#12733)

When building protobuf with BUILD_SHARED_LIBS disabled, conformance_test_runner should link jsoncpp_static but not jsoncpp_lib.

Closes protocolbuffers#12733

COPYBARA_INTEGRATE_REVIEW=protocolbuffers#12733 from semlanik:main 2ab4be6
PiperOrigin-RevId: 530926843
  • Loading branch information
semlanik authored and copybara-github committed May 10, 2023
1 parent 027d8df commit d372fcd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/conformance.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit d372fcd

Please sign in to comment.