Skip to content
Merged
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
10 changes: 9 additions & 1 deletion build-icu.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,14 @@ if (-not (Test-Path $ICU_SOURCE_DIR)) {
}

if ($Platform -eq "x64") {
$ArchFlag = if ($Baseline) { "/arch:SSE2" } else { "/arch:AVX2" }
$ArchFlag = if ($Baseline) { "/clang:-march=nehalem" } else { "/clang:-march=haswell" }
} else {
$ArchFlag = ""
}

# ClangCL for stage 2 so -march= limits codegen (MSVC /arch:SSE2 is a no-op on x64).
$ToolsetArg = if ($Platform -eq "x64") { @("/p:PlatformToolset=ClangCL") } else { @() }

# --- Function to patch vcxproj files for static library build with /MT ---
function Patch-IcuVcxProj {
param(
Expand Down Expand Up @@ -125,6 +128,10 @@ function Patch-IcuVcxProj {
$content = $content -replace '<OutputFile>[^<]*\.(dll|DLL)</OutputFile>', ''
$content = $content -replace '<ImportLibrary>[^<]*</ImportLibrary>', ''

# Strip .rc — rc.exe cannot parse clang stddef.h and static libs do not need version resources.
$content = $content -replace "(?s)<ResourceCompile[^>]*>.*?</ResourceCompile>", ""
$content = $content -replace "<ResourceCompile[^>]*/>", ""

# For stubdata - remove resource-only DLL settings
if ($FilePath -match "stubdata") {
$content = $content -replace '<NoEntryPoint>true</NoEntryPoint>', ''
Expand Down Expand Up @@ -235,6 +242,7 @@ foreach ($target in @("common", "i18n")) {
"/v:minimal"
)

$buildArgs += $ToolsetArg
& $msbuildPath $buildArgs

if ($LASTEXITCODE -ne 0) {
Expand Down
Loading