Bug 1882441 - Enable libxml2 support in windows clang. r=firefox-build-system-reviewers,ahochheiden

Differential Revision: https://phabricator.services.mozilla.com/D202902
This commit is contained in:
Mike Hommey 2024-02-29 22:53:01 +00:00
parent 8ece1d0381
commit 917cd1f7f1
2 changed files with 14 additions and 4 deletions

View File

@ -251,10 +251,7 @@ def build_one_stage(
cmake_args.append("-DLLVM_ENABLE_PROJECTS=%s" % ";".join(projects))
# There is no libxml2 on Windows except if we build one ourselves.
# libxml2 is only necessary for llvm-mt, but Windows can just use the
# native MT tool.
if not is_windows(target) and is_final_stage:
if is_final_stage:
cmake_args += ["-DLLVM_ENABLE_LIBXML2=FORCE_ON"]
if is_linux(target) and is_final_stage:
sysroot = os.path.join(os.environ.get("MOZ_FETCHES_DIR", ""), "sysroot")
@ -277,6 +274,13 @@ def build_one_stage(
f"-DLLVM_WINSYSROOT={os.environ['VSINSTALLDIR']}",
"-DLLVM_DISABLE_ASSEMBLY_FILES=ON",
]
if is_final_stage:
fetches = os.environ["MOZ_FETCHES_DIR"]
cmake_args += [
"-DLIBXML2_DEFINITIONS=-DLIBXML_STATIC",
f"-DLIBXML2_INCLUDE_DIR={fetches}/libxml2/include/libxml2",
f"-DLIBXML2_LIBRARIES={fetches}/libxml2/lib/libxml2s.lib",
]
else:
# libllvm as a shared library is not supported on Windows
cmake_args += ["-DLLVM_LINK_LLVM_DYLIB=ON"]

View File

@ -437,6 +437,7 @@ win64-clang-17-stage1:
toolchain:
- linux64-clang-17-stage1
- vs-toolchain
- win64-libxml2
win64-clang-17-raw:
description: "Clang-cl 17 toolchain build"
@ -467,6 +468,7 @@ win64-clang-17-raw:
- win64-clang-17-stage1
- win64-compiler-rt-17
- vs-toolchain
- win64-libxml2
win64-clang-17:
description: "Clang-cl 17 toolchain build"
@ -801,6 +803,7 @@ win64-clang-18-stage1:
toolchain:
- linux64-clang-18-stage1
- vs-toolchain
- win64-libxml2
win64-clang-18-raw:
description: "Clang-cl 18 toolchain build"
@ -831,6 +834,7 @@ win64-clang-18-raw:
- win64-clang-18-stage1
- win64-compiler-rt-18
- vs-toolchain
- win64-libxml2
win64-clang-18:
description: "Clang-cl 18 toolchain build"
@ -1207,6 +1211,7 @@ win64-clang-trunk-stage1:
toolchain:
- linux64-clang-trunk-stage1
- vs-toolchain
- win64-libxml2
win64-clang-trunk-raw:
description: "Clang-cl trunk toolchain build"
@ -1239,6 +1244,7 @@ win64-clang-trunk-raw:
- win64-clang-trunk-stage1
- win64-compiler-rt-trunk
- vs-toolchain
- win64-libxml2
win64-clang-trunk:
description: "Clang-cl trunk toolchain build"