Skip to content

Commit d372fcd

Browse files
semlanikcopybara-github
authored andcommitted
CMake: Use the correct jsoncpp target name in static builds (#12733)
When building protobuf with BUILD_SHARED_LIBS disabled, conformance_test_runner should link jsoncpp_static but not jsoncpp_lib. Closes #12733 COPYBARA_INTEGRATE_REVIEW=#12733 from semlanik:main 2ab4be6 PiperOrigin-RevId: 530926843
1 parent 027d8df commit d372fcd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/conformance.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ set(JSONCPP_WITH_TESTS OFF CACHE BOOL "Disable tests")
9090
if(protobuf_JSONCPP_PROVIDER STREQUAL "module")
9191
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/jsoncpp third_party/jsoncpp)
9292
target_include_directories(conformance_test_runner PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/jsoncpp/include)
93-
target_link_libraries(conformance_test_runner jsoncpp_lib)
93+
if(BUILD_SHARED_LIBS)
94+
target_link_libraries(conformance_test_runner jsoncpp_lib)
95+
else()
96+
target_link_libraries(conformance_test_runner jsoncpp_static)
97+
endif()
9498
else()
9599
target_link_libraries(conformance_test_runner jsoncpp)
96100
endif()

0 commit comments

Comments
 (0)