From cfcfd8a056eb7c01bc76b745ce9f7839f0dcbc42 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 27 Nov 2019 12:55:46 -0800 Subject: [PATCH] build: avoid cached literals being linked against If the value of the LibXml2 search is cached, it can cause an errant link against LIBXML2_LIBRARIES-NOTFOUND if libxml2 is not found. Add a guard against this. Should repair the build bots. --- llvm/lib/WindowsManifest/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt index 8868564..fe6ddcd 100644 --- a/llvm/lib/WindowsManifest/CMakeLists.txt +++ b/llvm/lib/WindowsManifest/CMakeLists.txt @@ -3,10 +3,10 @@ add_llvm_component_library(LLVMWindowsManifest ADDITIONAL_HEADER_DIRS ${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest - ${Backtrace_INCLUDE_DIRS} + ${Backtrace_INCLUDE_DIRS}) - LINK_LIBS ${LIBXML2_LIBRARIES} - ) - -set_property(TARGET LLVMWindowsManifest PROPERTY - LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) +if(LIBXML2_LIBRARIES) + target_link_libraries(LLVMWindowsManifest PUBLIC ${LIBXML2_LIBRARIES}) + set_property(TARGET LLVMWindowsManifest PROPERTY + LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES}) +endif() -- 2.7.4