[llvm] cfcfd8a - build: avoid cached literals being linked against

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 12:57:20 PST 2019


Author: Saleem Abdulrasool
Date: 2019-11-27T12:55:46-08:00
New Revision: cfcfd8a056eb7c01bc76b745ce9f7839f0dcbc42

URL: https://github.com/llvm/llvm-project/commit/cfcfd8a056eb7c01bc76b745ce9f7839f0dcbc42
DIFF: https://github.com/llvm/llvm-project/commit/cfcfd8a056eb7c01bc76b745ce9f7839f0dcbc42.diff

LOG: 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.

Added: 
    

Modified: 
    llvm/lib/WindowsManifest/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt
index 8868564da76f..fe6ddcd414d5 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()


        


More information about the llvm-commits mailing list