Skip to content

build: enable libxml2 in the toolchain, use llvm-mt #77862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmake/caches/Windows-aarch64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set(LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "")
set(LLVM_BUILD_LLVM_DYLIB NO CACHE BOOL "")
set(LLVM_BUILD_LLVM_C_DYLIB NO CACHE BOOL "")
set(LLVM_ENABLE_LIBEDIT NO CACHE BOOL "")
set(LLVM_ENABLE_LIBXML2 NO CACHE BOOL "")
set(LLVM_ENABLE_LIBXML2 YES CACHE BOOL "")
set(LLVM_ENABLE_OCAMLDOC NO CACHE BOOL "")
set(LLVM_ENABLE_TERMINFO NO CACHE BOOL "")
set(LLVM_ENABLE_Z3_SOLVER NO CACHE BOOL "")
Expand All @@ -62,12 +62,14 @@ set(LLVM_INCLUDE_GO_TESTS NO CACHE BOOL "")
set(LLVM_TOOL_GOLD_BUILD NO CACHE BOOL "")
set(LLVM_TOOL_LLVM_SHLIB_BUILD NO CACHE BOOL "")

set(CLANG_ENABLE_LIBXML2 NO CACHE BOOL "")

# Avoid swig dependency for lldb
set(LLDB_ALLOW_STATIC_BINDINGS YES CACHE BOOL "")
set(LLDB_USE_STATIC_BINDINGS YES CACHE BOOL "")
set(LLDB_ENABLE_PYTHON YES CACHE BOOL "")
set(LLDB_EMBED_PYTHON_HOME NO CACHE BOOL "")
set(LLDB_ENABLE_LIBXML2 NO CACHE BOOL "")
set(LLDB_ENABLE_LIBXML2 YES CACHE BOOL "")

# This requires perl which may not be available on Windows
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
Expand Down
6 changes: 4 additions & 2 deletions cmake/caches/Windows-x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ set(LLVM_TARGETS_TO_BUILD AArch64 ARM WebAssembly X86 CACHE STRING "")
set(LLVM_BUILD_LLVM_DYLIB NO CACHE BOOL "")
set(LLVM_BUILD_LLVM_C_DYLIB NO CACHE BOOL "")
set(LLVM_ENABLE_LIBEDIT NO CACHE BOOL "")
set(LLVM_ENABLE_LIBXML2 NO CACHE BOOL "")
set(LLVM_ENABLE_LIBXML2 YES CACHE BOOL "")
set(LLVM_ENABLE_OCAMLDOC NO CACHE BOOL "")
set(LLVM_ENABLE_TERMINFO NO CACHE BOOL "")
set(LLVM_ENABLE_Z3_SOLVER NO CACHE BOOL "")
Expand All @@ -102,12 +102,14 @@ set(LLVM_INCLUDE_GO_TESTS NO CACHE BOOL "")
set(LLVM_TOOL_GOLD_BUILD NO CACHE BOOL "")
set(LLVM_TOOL_LLVM_SHLIB_BUILD NO CACHE BOOL "")

set(CLANG_ENABLE_LIBXML2 NO CACHE BOOL "")

# Avoid swig dependency for lldb
set(LLDB_ALLOW_STATIC_BINDINGS YES CACHE BOOL "")
set(LLDB_USE_STATIC_BINDINGS YES CACHE BOOL "")
set(LLDB_ENABLE_PYTHON YES CACHE BOOL "")
set(LLDB_EMBED_PYTHON_HOME NO CACHE BOOL "")
set(LLDB_ENABLE_LIBXML2 NO CACHE BOOL "")
set(LLDB_ENABLE_LIBXML2 YES CACHE BOOL "")

# This requires perl which may not be available on Windows
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")
Expand Down
16 changes: 8 additions & 8 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,6 @@ function Build-CMakeProject {
}

TryAdd-KeyValue $Defines CMAKE_BUILD_TYPE Release
TryAdd-KeyValue $Defines CMAKE_MT "mt"

$CFlags = @()
switch ($Platform) {
Expand Down Expand Up @@ -1411,6 +1410,8 @@ function Build-BuildTools($Arch) {
-BuildTargets llvm-tblgen,clang-tblgen,clang-pseudo-gen,clang-tidy-confusable-chars-gen,lldb-tblgen,llvm-config,swift-def-to-strings-converter,swift-serialize-diagnostics,swift-compatibility-symbols `
-Defines @{
CMAKE_CROSSCOMPILING = "NO";
CLANG_ENABLE_LIBXML2 = "NO";
LLDB_ENABLE_LIBXML2 = "NO";
LLDB_ENABLE_PYTHON = "NO";
LLDB_INCLUDE_TESTS = "NO";
LLDB_ENABLE_SWIFT_SUPPORT = "NO";
Expand Down Expand Up @@ -1509,7 +1510,9 @@ function Build-Compilers() {
-Defines ($TestingDefines + @{
CLANG_TABLEGEN = (Join-Path -Path $BuildTools -ChildPath "clang-tblgen.exe");
CLANG_TIDY_CONFUSABLE_CHARS_GEN = (Join-Path -Path $BuildTools -ChildPath "clang-tidy-confusable-chars-gen.exe");
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
CMAKE_Swift_FLAGS = $SwiftFlags;
LibXml2_DIR = "$LibraryRoot\libxml2-2.11.5\usr\lib\Windows\$($Arch.LLVMName)\cmake\libxml2-2.11.5";
LLDB_PYTHON_EXE_RELATIVE_PATH = "python.exe";
LLDB_PYTHON_EXT_SUFFIX = ".pyd";
LLDB_PYTHON_RELATIVE_PATH = "lib/site-packages";
Expand Down Expand Up @@ -1932,14 +1935,9 @@ function Build-Foundation([Platform]$Platform, $Arch, [switch]$Test = $false) {
-Defines (@{
ENABLE_TESTING = "NO";
FOUNDATION_BUILD_TOOLS = if ($Platform -eq "Windows") { "YES" } else { "NO" };
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
CURL_DIR = "$LibraryRoot\curl-8.9.1\usr\lib\$Platform\$ShortArch\cmake\CURL";
LIBXML2_LIBRARY = if ($Platform -eq "Windows") {
"$LibraryRoot\libxml2-2.11.5\usr\lib\$Platform\$ShortArch\libxml2s.lib";
} else {
"$LibraryRoot\libxml2-2.11.5\usr\lib\$Platform\$ShortArch\libxml2.a";
};
LIBXML2_INCLUDE_DIR = "$LibraryRoot\libxml2-2.11.5\usr\include\libxml2";
LIBXML2_DEFINITIONS = "-DLIBXML_STATIC";
LibXml2_DIR = "$LibraryRoot\libxml2-2.11.5\usr\lib\$Platform\$ShortArch\cmake\libxml2-2.11.5";
ZLIB_LIBRARY = if ($Platform -eq "Windows") {
"$LibraryRoot\zlib-1.3.1\usr\lib\$Platform\$ShortArch\zlibstatic.lib"
} else {
Expand Down Expand Up @@ -2780,13 +2778,15 @@ if (-not $SkipBuild) {
Invoke-BuildStep Build-CMark $BuildArch
Invoke-BuildStep Build-BuildTools $BuildArch
if ($IsCrossCompiling) {
Invoke-BuildStep Build-XML2 Windows $BuildArch
Invoke-BuildStep Build-Compilers -Build $BuildArch
}
if ($IncludeDS2) {
Invoke-BuildStep Build-RegsGen2 $BuildArch
}

Invoke-BuildStep Build-CMark $HostArch
Invoke-BuildStep Build-XML2 Windows $HostArch
Invoke-BuildStep Build-Compilers $HostArch
}

Expand Down