From 2e75681b55ab55301022533b203269f5f3d6f909 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Mon, 2 Dec 2019 14:30:16 -0800 Subject: [PATCH] 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 340e7c0b77a7037afefe7255503afe362967b577 and 340e7c0b77a7037afefe7255503afe362967b577. --- llvm/cmake/config-ix.cmake | 1 + llvm/lib/WindowsManifest/CMakeLists.txt | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index e7e5e5dcf2ff..028a2cc86bf3 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -166,6 +166,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") else() include_directories(${LIBXML2_INCLUDE_DIR}) endif() + set(LIBXML2_LIBS "xml2") endif() endif() endif() diff --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt index fe6ddcd414d5..4f2d011d5434 100644 --- a/llvm/lib/WindowsManifest/CMakeLists.txt +++ b/llvm/lib/WindowsManifest/CMakeLists.txt @@ -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 WindowsManifestMerger.cpp ADDITIONAL_HEADER_DIRS ${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest - ${Backtrace_INCLUDE_DIRS}) + ${Backtrace_INCLUDE_DIRS} -if(LIBXML2_LIBRARIES) - target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES}) - set_property(TARGET LLVMWindowsManifest PROPERTY - LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) -endif() + LINK_LIBS ${system_libs} + ) + +set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")