contrib/libxml2: use hidden library

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-01-20 17:24:17 +03:00
parent e0690bf2c1
commit ccf5f18550

View File

@ -50,14 +50,14 @@ set(SRCS
"${LIBXML2_SOURCE_DIR}/schematron.c"
"${LIBXML2_SOURCE_DIR}/xzlib.c"
)
add_library(libxml2 ${SRCS})
add_library(_libxml2 ${SRCS})
target_link_libraries(libxml2 PRIVATE ch_contrib::zlib)
target_link_libraries(_libxml2 PRIVATE ch_contrib::zlib)
if(M_LIBRARY)
target_link_libraries(libxml2 PRIVATE ${M_LIBRARY})
target_link_libraries(_libxml2 PRIVATE ${M_LIBRARY})
endif()
target_include_directories(libxml2 BEFORE PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/linux_x86_64/include")
target_include_directories(libxml2 BEFORE PUBLIC "${LIBXML2_SOURCE_DIR}/include")
target_include_directories(_libxml2 BEFORE PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/linux_x86_64/include")
target_include_directories(_libxml2 BEFORE PUBLIC "${LIBXML2_SOURCE_DIR}/include")
add_library(ch_contrib::libxml2 ALIAS libxml2)
add_library(ch_contrib::libxml2 ALIAS _libxml2)