Temporarily revert "build: avoid hardcoding the libxml2 library name"

as it breaks uses of llvm-config --system-libs and the follow-on commit
"build: avoid cached literals being linked against"

This reverts commits 340e7c0b77 and
340e7c0b77.
This commit is contained in:
Eric Christopher 2019-12-02 14:30:16 -08:00
parent 936de1c5bc
commit 2e75681b55
2 changed files with 13 additions and 6 deletions

View File

@ -166,6 +166,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
else() else()
include_directories(${LIBXML2_INCLUDE_DIR}) include_directories(${LIBXML2_INCLUDE_DIR})
endif() endif()
set(LIBXML2_LIBS "xml2")
endif() endif()
endif() endif()
endif() endif()

View File

@ -1,12 +1,18 @@
set(system_libs)
if( CMAKE_HOST_UNIX )
if( LLVM_LIBXML2_ENABLED )
set(system_libs ${system_libs} ${LIBXML2_LIBS})
endif()
endif()
add_llvm_component_library(LLVMWindowsManifest add_llvm_component_library(LLVMWindowsManifest
WindowsManifestMerger.cpp WindowsManifestMerger.cpp
ADDITIONAL_HEADER_DIRS ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest ${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest
${Backtrace_INCLUDE_DIRS}) ${Backtrace_INCLUDE_DIRS}
if(LIBXML2_LIBRARIES) LINK_LIBS ${system_libs}
target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES}) )
set_property(TARGET LLVMWindowsManifest PROPERTY
LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")
endif()