Skip to content
Snippets Groups Projects
Commit fe4ffa75 authored by Guilherme Amadio's avatar Guilherme Amadio
Browse files

Use all-keyword style in target_link_libraries()

When using builtin_openssl=ON, CMake erroneously exports the builtin
static libraries in ROOTConfig-targets.cmake, which causes problems with
dependent projects. In order to avoid this, we need Net and RHTTP to use
SSL as a private dependency. Since CMake requires target_link_libraries()
to either be all-plain (as before) or all-keyword (required to allow
PRIVATE linking), we need to move the build system to use all-keyword
linking only.

Fixes: ROOT-9532
parent c7e1cf4f
No related branches found
No related tags found
No related merge requests found
......@@ -655,9 +655,9 @@ function(ROOT_LINKER_LIBRARY library)
set_target_properties(${library} PROPERTIES ${ROOT_LIBRARY_PROPERTIES} )
endif()
if(explicitlink OR ROOT_explicitlink_FOUND)
target_link_libraries(${library} ${ARG_LIBRARIES} ${ARG_DEPENDENCIES})
target_link_libraries(${library} PUBLIC ${ARG_LIBRARIES} ${ARG_DEPENDENCIES})
else()
target_link_libraries(${library} ${ARG_LIBRARIES})
target_link_libraries(${library} PUBLIC ${ARG_LIBRARIES})
endif()
endif()
if(TARGET G__${library})
......
......@@ -104,7 +104,7 @@ if(MSVC)
endif()
if(APPLE)
target_link_libraries(Cling -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup)
target_link_libraries(Cling PUBLIC -Wl,-bind_at_load -Wl,-undefined -Wl,dynamic_lookup)
elseif(NOT MSVC)
target_link_libraries(Cling -Wl,--unresolved-symbols=ignore-in-object-files)
target_link_libraries(Cling PUBLIC -Wl,--unresolved-symbols=ignore-in-object-files)
endif()
......@@ -24,7 +24,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTVecOps
LIBRARIES Core)
if(vdt)
target_link_libraries(ROOTVecOps Vdt::Vdt)
target_link_libraries(ROOTVecOps PUBLIC Vdt::Vdt)
endif()
target_compile_options(ROOTVecOps PRIVATE -O3 -ffast-math)
......
......@@ -56,7 +56,7 @@ target_compile_definitions(RHTTP PUBLIC -DUSE_WEBSOCKET)
if(ssl)
target_compile_definitions(RHTTP PUBLIC -DNO_SSL_DL)
target_link_libraries(RHTTP ${OPENSSL_LIBRARIES})
target_link_libraries(RHTTP PRIVATE ${OPENSSL_LIBRARIES})
if(OPENSSL_VERSION AND (${OPENSSL_VERSION} VERSION_EQUAL "1.1"))
MESSAGE(STATUS "Use SSL API VERSION 1.1 for civetweb")
target_compile_definitions(RHTTP PUBLIC -DOPENSSL_API_1_1)
......
......@@ -32,5 +32,5 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Net
DEPENDENCIES RIO)
if(ssl)
target_link_libraries(Net ${OPENSSL_LIBRARIES} ${CRYPTLIBS})
target_link_libraries(Net PRIVATE ${OPENSSL_LIBRARIES} ${CRYPTLIBS})
endif()
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