Skip to content

Commit 340e7c0

Browse files
committed
build: avoid hardcoding the libxml2 library name
FindLibXml2 will set the LIBXML2_LIBRARIES variable to the libraries that we must link against. This will be an empty string if libxml2 is not found. Avoid hardcoding the library name as xml2 in the configuration. Simplify the usage in the WindowsManifest library.
1 parent dcceab1 commit 340e7c0

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
166166
else()
167167
include_directories(${LIBXML2_INCLUDE_DIR})
168168
endif()
169-
set(LIBXML2_LIBS "xml2")
170169
endif()
171170
endif()
172171
endif()
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
set(system_libs)
2-
if( CMAKE_HOST_UNIX )
3-
if( LLVM_LIBXML2_ENABLED )
4-
set(system_libs ${system_libs} ${LIBXML2_LIBS})
5-
endif()
6-
endif()
7-
81
add_llvm_component_library(LLVMWindowsManifest
92
WindowsManifestMerger.cpp
103

114
ADDITIONAL_HEADER_DIRS
125
${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest
136
${Backtrace_INCLUDE_DIRS}
147

15-
LINK_LIBS ${system_libs}
8+
LINK_LIBS ${LIBXML2_LIBRARIES}
169
)
1710

18-
set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")
11+
set_property(TARGET LLVMWindowsManifest PROPERTY
12+
LLVM_SYSTEM_LIBS ${LIBXML2_LIBRARIES})

0 commit comments

Comments
 (0)