Skip to content

Commit 8fe376f

Browse files
authored
[llvm] Fix incorrect usage of LIBXML2_INCLUDE_DIRS in the Windows release script (#95781)
Before this fix, when building the Windows LLVM package with the latest cmake 3.29.3 I was seeing: ``` C:\git\llvm-project>llvm\utils\release\build_llvm_release.bat --version 19.0.0 --x64 --skip-checkout --local-python ... -- Looking for FE_INEXACT -- Looking for FE_INEXACT - found -- Performing Test HAVE_BUILTIN_THREAD_POINTER -- Performing Test HAVE_BUILTIN_THREAD_POINTER - Failed -- Looking for mach/mach.h -- Looking for mach/mach.h - not found -- Looking for CrashReporterClient.h -- Looking for CrashReporterClient.h - not found -- Looking for pfm_initialize in pfm -- Looking for pfm_initialize in pfm - not found -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find LibXml2 (missing: LIBXML2_INCLUDE_DIR) Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/CMake/share/cmake-3.29/Modules/FindLibXml2.cmake:108 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cmake/config-ix.cmake:167 (find_package) CMakeLists.txt:921 (include) -- Configuring incomplete, errors occurred! ``` It looks like `LIBXML2_INCLUDE_DIRS` (with the extra 'S') is a result variable that is set by cmake after a call to `find_package(LibXml2)`. It is actually `LIBXML2_INCLUDE_DIR` (without the 'S') that shold be used as a input before the `find_package` call, since the 'S' variable is unconditionally overwritten, see https://github.com/Kitware/CMake/blob/master/Modules/FindLibXml2.cmake#L96. I am unsure exactly why that worked with older cmake versions.
1 parent 0851d7b commit 8fe376f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/utils/release/build_llvm_release.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ set cmake_flags=^
194194
-DLLDB_TEST_COMPILER=%stage0_bin_dir%/clang.exe ^
195195
-DPYTHON_HOME=%PYTHONHOME% ^
196196
-DPython3_ROOT_DIR=%PYTHONHOME% ^
197-
-DLIBXML2_INCLUDE_DIRS=%libxmldir%/include/libxml2 ^
197+
-DLIBXML2_INCLUDE_DIR=%libxmldir%/include/libxml2 ^
198198
-DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib
199199

200200
cmake -GNinja %cmake_flags% %llvm_src%\llvm || exit /b 1
@@ -250,7 +250,7 @@ set cmake_flags=^
250250
-DLLDB_TEST_COMPILER=%stage0_bin_dir%/clang.exe ^
251251
-DPYTHON_HOME=%PYTHONHOME% ^
252252
-DPython3_ROOT_DIR=%PYTHONHOME% ^
253-
-DLIBXML2_INCLUDE_DIRS=%libxmldir%/include/libxml2 ^
253+
-DLIBXML2_INCLUDE_DIR=%libxmldir%/include/libxml2 ^
254254
-DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib
255255

256256
cmake -GNinja %cmake_flags% %llvm_src%\llvm || exit /b 1
@@ -317,7 +317,7 @@ set "stage0_bin_dir=%build_dir%/build_arm64_stage0/bin"
317317
set cmake_flags=^
318318
%common_cmake_flags% ^
319319
-DCLANG_DEFAULT_LINKER=lld ^
320-
-DLIBXML2_INCLUDE_DIRS=%libxmldir%/include/libxml2 ^
320+
-DLIBXML2_INCLUDE_DIR=%libxmldir%/include/libxml2 ^
321321
-DLIBXML2_LIBRARIES=%libxmldir%/lib/libxml2s.lib ^
322322
-DPython3_ROOT_DIR=%PYTHONHOME% ^
323323
-DCOMPILER_RT_BUILD_PROFILE=OFF ^

0 commit comments

Comments
 (0)