Skip to content

[Build] Add flag to build-win.ps1 that allows to build Release.static target#1408

Open
lucianopa-msft wants to merge 4 commits intomicrosoft:mainfrom
lucianopa-msft:lucianopa/build-win-fix
Open

[Build] Add flag to build-win.ps1 that allows to build Release.static target#1408
lucianopa-msft wants to merge 4 commits intomicrosoft:mainfrom
lucianopa-msft:lucianopa/build-win-fix

Conversation

@lucianopa-msft
Copy link
Member

We are building using this build-win.ps1 but we wanted to be able to use the "Release.static" target. But currently there is no such option to that.
We currently have our own workaround:

function Repair-BuildScript {
    param (
        [string]$RepoPath
    )
    # Modify build-win.ps1 to use Release.static target instead of Release.vc14x.MT-sqlite.
    # This is unfortunate, but the build script does not take parameters for this setting, if we specify libTypes to lib it forces us for MT-sqlite
    $filePath = "$RepoPath\build-win.ps1"
    $oldText = '".vc14x.MT-sqlite"'
    $newText = '".static"'

    # Read, replace, and save the file
    (Get-Content $filePath) -replace $oldText, $newText | Set-Content $filePath
}

Which is fine, but sending this PR aiming to allow that option as well. Default remains true to not modify current behavior.

@lucianopa-msft lucianopa-msft requested a review from a team as a code owner January 28, 2026 15:16
@lucianopa-msft lucianopa-msft force-pushed the lucianopa/build-win-fix branch from d170ce2 to 0c41a33 Compare January 28, 2026 15:24
ThomsonTan and others added 2 commits January 28, 2026 09:58
@lucianopa-msft
Copy link
Member Author

cc @ThomsonTan

if ($libMTSqlite -eq "true") {
$actualConfig += ".vc14x.MT-sqlite"
} else {
$actualConfig += ".static"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because static libs are only supported for x86/x64, should a check be added here to do the guard?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants