Skip to content

Commit

Permalink
Improve 1k/build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Apr 1, 2024
1 parent 645439b commit d645aee
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions 1k/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ $options = @{
xb = @()
j = -1
sdk = $null
env = ''
dll = $false
}

Expand Down Expand Up @@ -321,11 +322,11 @@ function create_symlink($sourcePath, $destPath) {
}
}

$darwin_sim_suffix = ''
if ($TARGET_OS.EndsWith('-sim')) {
$TARGET_OS = $TARGET_OS.TrimEnd('-sim')
$darwin_sim_suffix = '-sim'
$Global:darwin_sim_suffix = $null
if ($options.env.StartsWith('sim')) {
$Global:darwin_sim_suffix = '_sim'
}

$Global:is_wasm = $TARGET_OS -eq 'wasm'
$Global:is_win32 = $TARGET_OS -eq 'win32'
$Global:is_winrt = $TARGET_OS -eq 'winrt'
Expand Down Expand Up @@ -1393,6 +1394,9 @@ function preprocess_ios([string[]]$inputOptions) {
elseif ($Global:is_watchos) {
$outputOptions += '-DPLAT=watchOS'
}
if($Global:darwin_sim_suffix) {
$outputOptions += '-DSIMULATOR=TRUE'
}
}
return $outputOptions
}
Expand Down Expand Up @@ -1529,6 +1533,9 @@ if (!$setupOnly) {
$out_dir += "_$TARGET_CPU"
}
}
if ($Global:darwin_sim_suffix) {
$out_dir += $Global:darwin_sim_suffix
}
return $b1k.realpath($out_dir)
}

Expand Down Expand Up @@ -1753,7 +1760,7 @@ if (!$setupOnly) {
}
elseif ($Global:is_ios) {
$gn_buildargs_overrides += 'target_os=\"ios\"'
if ($TARGET_CPU -eq 'x64') {
if ($TARGET_CPU -eq 'x64' -or $Global:darwin_sim_suffix) {
$gn_buildargs_overrides += 'target_environment=\"simulator\"'
}
}
Expand Down Expand Up @@ -1795,7 +1802,7 @@ if (!$setupOnly) {
$gn_gen_args = @('gen', $BUILD_DIR)
if ($Global:is_win_family) {
$sln_name = Split-Path $(Get-Location).Path -Leaf
$gn_gen_args += '--ide=vs2022', '--sln=$sln_name'
$gn_gen_args += '--ide=vs2022', "--sln=$sln_name"
}

if ($gn_buildargs_overrides) {
Expand Down

0 comments on commit d645aee

Please sign in to comment.