Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Jan 4, 2025
1 parent a6bbef5 commit b72d5f2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
19 changes: 15 additions & 4 deletions 1k/1kiss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2030,10 +2030,21 @@ if (!$setupOnly) {
$forward_options += '--', '-quiet'
}

if ($options.t) { $cmake_target = $options.t }
if ($cmake_target) {
$cmake_targets = $cmake_target.Split(',')
foreach ($target in $cmake_targets) {
$cm_targets = $options.t

if($cm_targets) {
if($cm_targets -isnot [array]) {
$cm_targets = "$($cm_targets)".Split(',')
}
} else {
$cm_targets = @()
}
if($cmake_target -and !$cm_targets.Contains($cmake_target)) {
$cm_targets += $cmake_target
}

if ($cm_targets) {
foreach ($target in $cm_targets) {
$1k.println("cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS --target $target")
cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS --target $target $forward_options | Out-Host
if (!$?) {
Expand Down
22 changes: 13 additions & 9 deletions tools/cmdline/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ param(

$unhandled_args = @()

$options = @{p = $null; d = $null; xc = @(); xb = @(); }
$options = @{p = $null; d = $null; xc = @(); xb = @(); t = @() }

$optName = $null
foreach ($arg in $args) {
Expand Down Expand Up @@ -150,14 +150,18 @@ if ($use_gradle) {
if (!$use_gradle) {
if (!$cmake_target) {
# non android, specific cmake target
$cmake_targets = @(
# project
$proj_name,
# engine
'cpp-tests'
)
$cmake_target = $cmake_targets[$is_axmol_engine]
$options.xb += '--target', $cmake_target
$cmake_target = @($proj_name, 'cpp-tests')[$is_axmol_engine]

if($options.t) {
if($options.t -isnot [array]) {
$options.t = "$($options.t)".Split(',')
}
if(!$options.t.Contains($cmake_target)) {
$options.t += $cmake_target
}
} else {
$options.t = @($cmake_target)
}
}

if ($is_android -and !"$($options.xc)".Contains('-DANDROID_STL')) {
Expand Down

0 comments on commit b72d5f2

Please sign in to comment.