https://github.com/keith updated https://github.com/llvm/llvm-project/pull/166867
>From c59a18a63e0953496422e7b4b89dd49532db3cbd Mon Sep 17 00:00:00 2001 From: Keith Smiley <[email protected]> Date: Thu, 4 Dec 2025 16:54:54 +0000 Subject: [PATCH 1/6] redo without external build --- clang/cmake/caches/Release.cmake | 1 + llvm/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake index efe20a201dbc9..44d5aaabe675c 100644 --- a/clang/cmake/caches/Release.cmake +++ b/clang/cmake/caches/Release.cmake @@ -172,6 +172,7 @@ set_final_stage_var(CPACK_GENERATOR "TXZ" STRING) set_final_stage_var(CPACK_ARCHIVE_THREADS "0" STRING) set_final_stage_var(LLVM_USE_STATIC_ZSTD "ON" BOOL) +set_final_stage_var(LLVM_USE_STATIC_LIBXML2 "ON" BOOL) if (LLVM_RELEASE_ENABLE_LTO) set_final_stage_var(LLVM_ENABLE_FATLTO "ON" BOOL) set_final_stage_var(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/release_cpack_pre_build_strip_lto.cmake" STRING) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 420774b629b8b..75c5aec1def3e 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -606,6 +606,8 @@ set(LLVM_TARGET_ARCH "host" set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON, OFF, or FORCE_ON") +set(LLVM_USE_STATIC_LIBXML2 "OFF" CACHE BOOL "Use static version of libxml2. Can be ON, or OFF") + option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON) option(LLVM_ENABLE_LIBPFM "Use libpfm for performance counters if available." ON) >From c6542f9236d60d3432aad877c5ea763d6970a491 Mon Sep 17 00:00:00 2001 From: Keith Smiley <[email protected]> Date: Thu, 4 Dec 2025 17:17:48 +0000 Subject: [PATCH 2/6] re-work --- lldb/source/Host/CMakeLists.txt | 2 +- llvm/cmake/modules/FindLibXml2.cmake | 81 ++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 llvm/cmake/modules/FindLibXml2.cmake diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt index 651f3f09c471c..8559165b5e6e3 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -157,7 +157,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") list(APPEND EXTRA_LIBS kvm) endif() if (LLDB_ENABLE_LIBXML2) - list(APPEND EXTRA_LIBS LibXml2::LibXml2) + list(APPEND EXTRA_LIBS LibXml2::LibXml2Shared) endif() if (HAVE_LIBDL) list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) diff --git a/llvm/cmake/modules/FindLibXml2.cmake b/llvm/cmake/modules/FindLibXml2.cmake new file mode 100644 index 0000000000000..2dc5aa2594eac --- /dev/null +++ b/llvm/cmake/modules/FindLibXml2.cmake @@ -0,0 +1,81 @@ +# Based on https://gitlab.kitware.com/cmake/cmake/-/blob/3986f4b79ea6bf247eefad7ddb883cd6f65ac5c1/Modules/FindLibXml2.cmake +# With support for using a static libxml2 library + +# use pkg-config to get the directories and then use these values +# in the find_path() and find_library() calls +find_package(PkgConfig QUIET) +if(PkgConfig_FOUND) + pkg_check_modules(PC_LIBXML QUIET libxml-2.0) +endif() + +find_path(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h + HINTS + ${PC_LIBXML_INCLUDEDIR} + ${PC_LIBXML_INCLUDE_DIRS} + PATH_SUFFIXES libxml2 +) + +if(DEFINED LIBXML2_LIBRARIES AND NOT DEFINED LIBXML2_LIBRARY) + set(LIBXML2_LIBRARY ${LIBXML2_LIBRARIES}) +endif() + +find_library(LIBXML2_SHARED_LIBRARY NAMES xml2 libxml2 libxml2_a + HINTS + ${PC_LIBXML_LIBDIR} + ${PC_LIBXML_LIBRARY_DIRS} +) + +if(LLVM_USE_STATIC_LIBXML2) + set(_original_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) + if(UNIX) + set(CMAKE_FIND_LIBRARY_SUFFIXES .a) + elseif(WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a) + endif() + + find_library(LIBXML2_STATIC_LIBRARY NAMES xml2 libxml2 libxml2_a + HINTS + ${PC_LIBXML_LIBDIR} + ${PC_LIBXML_LIBRARY_DIRS} + ) + + if(LIBXML2_STATIC_LIBRARY STREQUAL "LIBXML2_STATIC_LIBRARY-NOTFOUND") + message(FATAL_ERROR "Static libxml2 requested (LLVM_USE_STATIC_LIBXML2=ON) but not found") + endif() + + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_original_suffixes}) + set(LIBXML2_LIBRARY ${LIBXML2_STATIC_LIBRARY}) +else() + set(LIBXML2_LIBRARY ${LIBXML2_SHARED_LIBRARY}) +endif() + +set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY}) +set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}) + +unset(LIBXML2_DEFINITIONS) +foreach(libxml2_pc_lib_dir IN LISTS PC_LIBXML_LIBDIR PC_LIBXML_LIBRARY_DIRS) + if (LIBXML2_LIBRARY MATCHES "^${libxml2_pc_lib_dir}") + list(APPEND LIBXML2_INCLUDE_DIRS ${PC_LIBXML_INCLUDE_DIRS}) + set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) + break() + endif() +endforeach() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibXml2 + REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR + VERSION_VAR LibXml2_VERSION) + +mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARY) + +if(LibXml2_FOUND AND NOT TARGET LibXml2::LibXml2) + add_library(LibXml2::LibXml2 UNKNOWN IMPORTED) + set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}") + set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}") + set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY IMPORTED_LOCATION "${LIBXML2_LIBRARY}") + + add_library(LibXml2::LibXml2Shared UNKNOWN IMPORTED) + set_target_properties(LibXml2::LibXml2Shared PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}") + set_target_properties(LibXml2::LibXml2Shared PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}") + set_property(TARGET LibXml2::LibXml2Shared APPEND PROPERTY IMPORTED_LOCATION "${LIBXML2_SHARED_LIBRARY}") +endif() >From 06ce43291781277319294f20293e3436f6d90cba Mon Sep 17 00:00:00 2001 From: Keith Smiley <[email protected]> Date: Thu, 4 Dec 2025 10:23:37 -0800 Subject: [PATCH 3/6] ignore on macOS --- llvm/cmake/modules/FindLibXml2.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llvm/cmake/modules/FindLibXml2.cmake b/llvm/cmake/modules/FindLibXml2.cmake index 2dc5aa2594eac..3af75f1a098c0 100644 --- a/llvm/cmake/modules/FindLibXml2.cmake +++ b/llvm/cmake/modules/FindLibXml2.cmake @@ -25,6 +25,11 @@ find_library(LIBXML2_SHARED_LIBRARY NAMES xml2 libxml2 libxml2_a ${PC_LIBXML_LIBRARY_DIRS} ) +# This is a system lib on macOS, so we don't need to avoid the dependency +if(APPLE) + set(LLVM_USE_STATIC_LIBXML2 OFF) +endif() + if(LLVM_USE_STATIC_LIBXML2) set(_original_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) if(UNIX) >From 0d926f2b13fd98d279776a2dfc3db4f9438e8c8b Mon Sep 17 00:00:00 2001 From: Keith Smiley <[email protected]> Date: Fri, 13 Mar 2026 14:38:16 -0700 Subject: [PATCH 4/6] Rework to move LLVM specific logic out --- lldb/source/Host/CMakeLists.txt | 2 +- llvm/cmake/modules/FindLibXml2.cmake | 96 ++++++++++--------------- llvm/lib/WindowsManifest/CMakeLists.txt | 10 ++- 3 files changed, 45 insertions(+), 63 deletions(-) diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt index 8559165b5e6e3..651f3f09c471c 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -157,7 +157,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") list(APPEND EXTRA_LIBS kvm) endif() if (LLDB_ENABLE_LIBXML2) - list(APPEND EXTRA_LIBS LibXml2::LibXml2Shared) + list(APPEND EXTRA_LIBS LibXml2::LibXml2) endif() if (HAVE_LIBDL) list(APPEND EXTRA_LIBS ${CMAKE_DL_LIBS}) diff --git a/llvm/cmake/modules/FindLibXml2.cmake b/llvm/cmake/modules/FindLibXml2.cmake index 3af75f1a098c0..599506f9c734a 100644 --- a/llvm/cmake/modules/FindLibXml2.cmake +++ b/llvm/cmake/modules/FindLibXml2.cmake @@ -1,8 +1,15 @@ -# Based on https://gitlab.kitware.com/cmake/cmake/-/blob/3986f4b79ea6bf247eefad7ddb883cd6f65ac5c1/Modules/FindLibXml2.cmake -# With support for using a static libxml2 library +# Try to find the libxml2 library +# +# If successful, the following variables will be defined: +# LIBXML2_INCLUDE_DIR +# LIBXML2_LIBRARY +# LIBXML2_STATIC_LIBRARY +# LibXml2_FOUND +# +# Additionally, the following import targets will be defined: +# LibXml2::LibXml2 +# LibXml2::LibXml2Static (if the static library is found) -# use pkg-config to get the directories and then use these values -# in the find_path() and find_library() calls find_package(PkgConfig QUIET) if(PkgConfig_FOUND) pkg_check_modules(PC_LIBXML QUIET libxml-2.0) @@ -19,68 +26,39 @@ if(DEFINED LIBXML2_LIBRARIES AND NOT DEFINED LIBXML2_LIBRARY) set(LIBXML2_LIBRARY ${LIBXML2_LIBRARIES}) endif() -find_library(LIBXML2_SHARED_LIBRARY NAMES xml2 libxml2 libxml2_a +find_library(LIBXML2_LIBRARY NAMES xml2 libxml2 libxml2_a HINTS ${PC_LIBXML_LIBDIR} ${PC_LIBXML_LIBRARY_DIRS} ) -# This is a system lib on macOS, so we don't need to avoid the dependency -if(APPLE) - set(LLVM_USE_STATIC_LIBXML2 OFF) -endif() - -if(LLVM_USE_STATIC_LIBXML2) - set(_original_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) - if(UNIX) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a) - elseif(WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a) - endif() - - find_library(LIBXML2_STATIC_LIBRARY NAMES xml2 libxml2 libxml2_a - HINTS - ${PC_LIBXML_LIBDIR} - ${PC_LIBXML_LIBRARY_DIRS} - ) - - if(LIBXML2_STATIC_LIBRARY STREQUAL "LIBXML2_STATIC_LIBRARY-NOTFOUND") - message(FATAL_ERROR "Static libxml2 requested (LLVM_USE_STATIC_LIBXML2=ON) but not found") - endif() - - set(CMAKE_FIND_LIBRARY_SUFFIXES ${_original_suffixes}) - set(LIBXML2_LIBRARY ${LIBXML2_STATIC_LIBRARY}) -else() - set(LIBXML2_LIBRARY ${LIBXML2_SHARED_LIBRARY}) -endif() - -set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY}) -set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}) - -unset(LIBXML2_DEFINITIONS) -foreach(libxml2_pc_lib_dir IN LISTS PC_LIBXML_LIBDIR PC_LIBXML_LIBRARY_DIRS) - if (LIBXML2_LIBRARY MATCHES "^${libxml2_pc_lib_dir}") - list(APPEND LIBXML2_INCLUDE_DIRS ${PC_LIBXML_INCLUDE_DIRS}) - set(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) - break() - endif() -endforeach() +find_library(LIBXML2_STATIC_LIBRARY NAMES + "${CMAKE_STATIC_LIBRARY_PREFIX}xml2${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${CMAKE_STATIC_LIBRARY_PREFIX}libxml2${CMAKE_STATIC_LIBRARY_SUFFIX}" + HINTS + ${PC_LIBXML_LIBDIR} + ${PC_LIBXML_LIBRARY_DIRS} +) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LibXml2 - REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR - VERSION_VAR LibXml2_VERSION) - -mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARY) - -if(LibXml2_FOUND AND NOT TARGET LibXml2::LibXml2) - add_library(LibXml2::LibXml2 UNKNOWN IMPORTED) - set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}") - set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}") - set_property(TARGET LibXml2::LibXml2 APPEND PROPERTY IMPORTED_LOCATION "${LIBXML2_LIBRARY}") + REQUIRED_VARS LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR + VERSION_VAR PC_LIBXML_VERSION +) - add_library(LibXml2::LibXml2Shared UNKNOWN IMPORTED) - set_target_properties(LibXml2::LibXml2Shared PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}") - set_target_properties(LibXml2::LibXml2Shared PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}") - set_property(TARGET LibXml2::LibXml2Shared APPEND PROPERTY IMPORTED_LOCATION "${LIBXML2_SHARED_LIBRARY}") +if(LibXml2_FOUND) + if(NOT TARGET LibXml2::LibXml2) + add_library(LibXml2::LibXml2 UNKNOWN IMPORTED) + set_target_properties(LibXml2::LibXml2 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIR}" + IMPORTED_LOCATION "${LIBXML2_LIBRARY}") + endif() + if(LIBXML2_STATIC_LIBRARY AND NOT TARGET LibXml2::LibXml2Static) + add_library(LibXml2::LibXml2Static STATIC IMPORTED) + set_target_properties(LibXml2::LibXml2Static PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIR}" + IMPORTED_LOCATION "${LIBXML2_STATIC_LIBRARY}") + endif() endif() + +mark_as_advanced(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARY LIBXML2_STATIC_LIBRARY) diff --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt index 910132a4c7dec..9ed819d2386b9 100644 --- a/llvm/lib/WindowsManifest/CMakeLists.txt +++ b/llvm/lib/WindowsManifest/CMakeLists.txt @@ -1,7 +1,11 @@ include(GetLibraryName) if(LLVM_ENABLE_LIBXML2) - set(imported_libs LibXml2::LibXml2) + if(TARGET LibXml2::LibXml2Static AND LLVM_USE_STATIC_LIBXML2) + set(imported_libs LibXml2::LibXml2Static) + else() + set(imported_libs LibXml2::LibXml2) + endif() endif() add_llvm_component_library(LLVMWindowsManifest @@ -24,10 +28,10 @@ if(LLVM_ENABLE_LIBXML2) # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. if(CMAKE_BUILD_TYPE) string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) - get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) + get_property(libxml2_library TARGET ${imported_libs} PROPERTY LOCATION_${build_type}) endif() if(NOT libxml2_library) - get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) + get_property(libxml2_library TARGET ${imported_libs} PROPERTY LOCATION) endif() get_library_name(${libxml2_library} libxml2_library) set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) >From 6b3cd024f57c7949c28981c0170fe8f053576772 Mon Sep 17 00:00:00 2001 From: Keith Smiley <[email protected]> Date: Fri, 13 Mar 2026 15:30:05 -0700 Subject: [PATCH 5/6] check static lib links --- llvm/cmake/config-ix.cmake | 19 ++++++++++++++++--- llvm/cmake/modules/FindLibXml2.cmake | 11 +++++++++++ llvm/lib/WindowsManifest/CMakeLists.txt | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index a12eaf76d15df..c55cb8a2e40cb 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -219,14 +219,27 @@ if(LLVM_ENABLE_LIBXML2) # Check if libxml2 we found is usable; for example, we may have found a 32-bit # library on a 64-bit system which would result in a link-time failure. cmake_push_check_state() - list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBXML2_INCLUDE_DIRS}) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBRARIES}) - list(APPEND CMAKE_REQUIRED_DEFINITIONS ${LIBXML2_DEFINITIONS}) + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBXML2_INCLUDE_DIR}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBRARY}) check_symbol_exists(xmlReadMemory libxml/xmlreader.h HAVE_LIBXML2) cmake_pop_check_state() if(LLVM_ENABLE_LIBXML2 STREQUAL FORCE_ON AND NOT HAVE_LIBXML2) message(FATAL_ERROR "Failed to configure libxml2") endif() + + if(LLVM_USE_STATIC_LIBXML2) + if(NOT TARGET LibXml2::LibXml2Static) + message(FATAL_ERROR "Failed to find static libxml2 library, but LLVM_USE_STATIC_LIBXML2=ON") + endif() + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBXML2_INCLUDE_DIR}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBXML2_STATIC_LIBRARY} ${LIBXML2_STATIC_DEPS}) + check_symbol_exists(xmlReadMemory libxml/xmlreader.h HAVE_LIBXML2_STATIC) + cmake_pop_check_state() + if(NOT HAVE_LIBXML2_STATIC) + message(FATAL_ERROR "Failed to configure static libxml2, but LLVM_USE_STATIC_LIBXML2=ON") + endif() + endif() endif() set(LLVM_ENABLE_LIBXML2 "${HAVE_LIBXML2}") endif() diff --git a/llvm/cmake/modules/FindLibXml2.cmake b/llvm/cmake/modules/FindLibXml2.cmake index 599506f9c734a..24080bb1aeab2 100644 --- a/llvm/cmake/modules/FindLibXml2.cmake +++ b/llvm/cmake/modules/FindLibXml2.cmake @@ -58,6 +58,17 @@ if(LibXml2_FOUND) set_target_properties(LibXml2::LibXml2Static PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIR}" IMPORTED_LOCATION "${LIBXML2_STATIC_LIBRARY}") + # Static libraries need their transitive dependencies for linking. + set(LIBXML2_STATIC_DEPS) + foreach(lib IN LISTS PC_LIBXML_STATIC_LIBRARIES) + if(NOT lib STREQUAL "xml2") + list(APPEND LIBXML2_STATIC_DEPS ${lib}) + endif() + endforeach() + if(LIBXML2_STATIC_DEPS) + set_target_properties(LibXml2::LibXml2Static PROPERTIES + INTERFACE_LINK_LIBRARIES "${LIBXML2_STATIC_DEPS}") + endif() endif() endif() diff --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt index 9ed819d2386b9..46fe3b50357b6 100644 --- a/llvm/lib/WindowsManifest/CMakeLists.txt +++ b/llvm/lib/WindowsManifest/CMakeLists.txt @@ -1,7 +1,7 @@ include(GetLibraryName) if(LLVM_ENABLE_LIBXML2) - if(TARGET LibXml2::LibXml2Static AND LLVM_USE_STATIC_LIBXML2) + if(LLVM_USE_STATIC_LIBXML2) set(imported_libs LibXml2::LibXml2Static) else() set(imported_libs LibXml2::LibXml2) >From 12e00a8694ce42bf803498256aab1353a2ae5d77 Mon Sep 17 00:00:00 2001 From: Keith Smiley <[email protected]> Date: Fri, 13 Mar 2026 15:47:14 -0700 Subject: [PATCH 6/6] enable for linux only --- clang/cmake/caches/Release.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake index 44d5aaabe675c..b0bc3ebfe5cb6 100644 --- a/clang/cmake/caches/Release.cmake +++ b/clang/cmake/caches/Release.cmake @@ -172,7 +172,10 @@ set_final_stage_var(CPACK_GENERATOR "TXZ" STRING) set_final_stage_var(CPACK_ARCHIVE_THREADS "0" STRING) set_final_stage_var(LLVM_USE_STATIC_ZSTD "ON" BOOL) -set_final_stage_var(LLVM_USE_STATIC_LIBXML2 "ON" BOOL) +if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux") + set_final_stage_var(LLVM_USE_STATIC_LIBXML2 "ON" BOOL) +endif() + if (LLVM_RELEASE_ENABLE_LTO) set_final_stage_var(LLVM_ENABLE_FATLTO "ON" BOOL) set_final_stage_var(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/release_cpack_pre_build_strip_lto.cmake" STRING) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
