diff --git a/1k/build.ps1 b/1k/build.ps1 index 805b4927e677..ec22b378ffb5 100644 --- a/1k/build.ps1 +++ b/1k/build.ps1 @@ -230,8 +230,7 @@ $options = @{ xc = @() xb = @() j = -1 - sdk = $null - env = '' + sdk = '' dll = $false } @@ -240,6 +239,9 @@ foreach ($arg in $args) { if (!$optName) { if ($arg.StartsWith('-')) { $optName = $arg.SubString(1) + if($optName.EndsWith(':')) { + $optName = $optName.TrimEnd(':') + } if ($optName.startsWith('j')) { $job_count = $null if ([int]::TryParse($optName.substring(1), [ref] $job_count)) { @@ -322,11 +324,6 @@ function create_symlink($sourcePath, $destPath) { } } -$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' @@ -363,7 +360,14 @@ else { $TARGET_CPU = $options.a = '*' } -$Global:is_darwin_embed_device = $Global:is_darwin_embed_family -and $TARGET_CPU -ne 'x64' -and !$darwin_sim_suffix +$Global:darwin_sim_suffix = $null +if ($Global:is_darwin_embed_family) { + if ($options.sdk.StartsWith('sim')) { + $Global:darwin_sim_suffix = '_sim' + } + $Global:is_ios_sim = $Global:darwin_sim_suffix -or ($TARGET_CPU -eq 'x64') +} +$Global:is_darwin_embed_device = $Global:is_darwin_embed_family -and !$Global:is_ios_sim if (!$setupOnly) { $b1k.println("$(Out-String -InputObject $options)") @@ -1394,7 +1398,7 @@ function preprocess_ios([string[]]$inputOptions) { elseif ($Global:is_watchos) { $outputOptions += '-DPLAT=watchOS' } - if($Global:darwin_sim_suffix) { + if($Global:is_ios_sim) { $outputOptions += '-DSIMULATOR=TRUE' } } @@ -1533,7 +1537,7 @@ if (!$setupOnly) { $out_dir += "_$TARGET_CPU" } } - if ($Global:darwin_sim_suffix) { + if ($Global:is_ios_sim) { $out_dir += $Global:darwin_sim_suffix } return $b1k.realpath($out_dir) @@ -1760,7 +1764,7 @@ if (!$setupOnly) { } elseif ($Global:is_ios) { $gn_buildargs_overrides += 'target_os=\"ios\"' - if ($TARGET_CPU -eq 'x64' -or $Global:darwin_sim_suffix) { + if ($Global:is_ios_sim) { $gn_buildargs_overrides += 'target_environment=\"simulator\"' } } diff --git a/1k/fetch.cmake b/1k/fetch.cmake index 20d220b88795..f648a2495c7a 100644 --- a/1k/fetch.cmake +++ b/1k/fetch.cmake @@ -27,7 +27,7 @@ function(_1kfetch_init) string(REPLACE "#" ";" _1kdist_url ${_1kdist_url}) list(GET _1kdist_url 0 _1kdist_base_url) list(GET _1kdist_url 1 _1kdist_ver) - set(_1kdist_base_url "${_1kdist_base_url}/v${_1kdist_ver}" PARENT_SCOPE) + set(_1kdist_base_url "${_1kdist_base_url}/${_1kdist_ver}" PARENT_SCOPE) set(_1kdist_ver ${_1kdist_ver} PARENT_SCOPE) endfunction() @@ -36,7 +36,7 @@ endfunction() function(_1kfetch_dist package_name) set(_prebuilt_root ${CMAKE_CURRENT_LIST_DIR}/_x) if(NOT IS_DIRECTORY ${_prebuilt_root}) - set (package_store "${_1kfetch_cache_dir}/1kdist/v${_1kdist_ver}/${package_name}.zip") + set (package_store "${_1kfetch_cache_dir}/1kdist/${_1kdist_ver}/${package_name}.zip") if (NOT EXISTS ${package_store}) set (package_url "${_1kdist_base_url}/${package_name}.zip") message(AUTHOR_WARNING "Downloading ${package_url}") @@ -67,10 +67,16 @@ function(_1kfetch_dist package_name) endfunction() function(_1kfetch uri) - set(oneValueArgs NAME) + set(oneValueArgs NAME REV) cmake_parse_arguments(opt "" "${oneValueArgs}" "" ${ARGN}) _1kparse_name(${uri} "${opt_NAME}") + + # rev: the explicit rev to checkout, i.e. git release tag name + set(_pkg_rev "") + if(opt_REV) + set(_pkg_rev ${opt_REV}) + endif() set(_pkg_store "${_1kfetch_cache_dir}/${_pkg_name}") execute_process(COMMAND ${PWSH_PROG} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/fetch.ps1 @@ -78,6 +84,7 @@ function(_1kfetch uri) -prefix "${_1kfetch_cache_dir}" -manifest "${_1kfetch_manifest}" -name "${_pkg_name}" + -rev "${_pkg_rev}" RESULT_VARIABLE _errorcode ) if (_errorcode) @@ -91,7 +98,7 @@ endfunction() function(_1kfetch_fast uri) _1kperf_start("_1kfetch: ${uri}") - set(oneValueArgs NAME) + set(oneValueArgs NAME REV) cmake_parse_arguments(opt "" "${oneValueArgs}" "" ${ARGN}) _1kparse_name(${uri} "${opt_NAME}") diff --git a/1k/fetch.ps1 b/1k/fetch.ps1 index d743151d31da..3151f273747a 100644 --- a/1k/fetch.ps1 +++ b/1k/fetch.ps1 @@ -54,7 +54,7 @@ function fetch_repo($url, $name, $dest, $ext) { } } catch { - Remove-Item $out -Force + Remove-Item $out -Force throw "fetch.ps1: extract $out failed, try again" } @@ -175,10 +175,8 @@ if (!$revision) { } if ($is_git_repo) { $old_rev_hash = $(git -C $lib_src rev-parse HEAD) - $tag_info = git -C $lib_src tag | Select-String $revision - if ($tag_info) { $revision = ([array]$tag_info.Line)[0] } + $cur_rev_hash = $(git -C $lib_src rev-parse --verify --quiet "$revision^{}") - if (!$cur_rev_hash) { git -C $lib_src fetch $cur_rev_hash = $(git -C $lib_src rev-parse --verify --quiet "$revision^{}") @@ -226,8 +224,7 @@ if (Test-Path (Join-Path $lib_src '.gn') -PathType Leaf) { # the repo use google gn build system manage deps and build Push-Location $lib_src # angle (A GLES native implementation by google) - if (Test-Path 'scripts/bootstrap.py' -PathType Leaf) - { + if (Test-Path 'scripts/bootstrap.py' -PathType Leaf) { python scripts/bootstrap.py } # darwin (A WebGPU native implementation by google) diff --git a/1k/ios.cmake b/1k/ios.cmake index 966a9b494959..f8458630a66e 100644 --- a/1k/ios.cmake +++ b/1k/ios.cmake @@ -1,5 +1,5 @@ # -# The minimal ios toolchain file: https://github.com/yasio/yasio/blob/dev/cmake/ios.cmake +# The minimal ios toolchain file: https://github.com/simdsoft/1kiss/blob/dev/1k/ios.cmake # version: 4.1.3 # # The supported params: diff --git a/manifest.json b/manifest.json index 4272029ab396..84e7acfcc96f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,10 @@ { "versions": { - "1kdist": "72", + "1kdist": "v72", "oboe": "1.8.1", - "kcp": "1.7-f2aa30e", - "lz4": "1.9.4", - "yaml-cpp": "0.8.0", + "kcp": "v1.7-f2aa30e", + "lz4": "v1.9.4", + "yaml-cpp": "v0.8.0", "box2d-optimized": "7ef46c1", "sample-assets": "master" },