From c0f82f960a624ea1e8b1e17e56dd8054792a4eb0 Mon Sep 17 00:00:00 2001 From: halx99 Date: Mon, 27 Jan 2025 00:15:56 +0800 Subject: [PATCH] Remove unused 3rd lib: yaml-cpp --- 1k/1kiss.ps1 | 65 +++++++++++++++++++++++++---------------- 3rdparty/CMakeLists.txt | 15 ---------- 3rdparty/README.md | 5 ---- manifest.json | 3 -- 4 files changed, 40 insertions(+), 48 deletions(-) diff --git a/1k/1kiss.ps1 b/1k/1kiss.ps1 index 866037a9bb8f..883f9f957f4e 100644 --- a/1k/1kiss.ps1 +++ b/1k/1kiss.ps1 @@ -65,8 +65,6 @@ param( $myRoot = $PSScriptRoot -$ErrorActionPreference = 'Stop' - $HOST_WIN = 0 # targets: win,uwp,android $HOST_LINUX = 1 # targets: linux,android $HOST_MAC = 2 # targets: android,ios,osx(macos),tvos,watchos @@ -86,12 +84,20 @@ $Global:EXE_SUFFIX = @('', '.exe')[$IsWin] $Script:cmake_generator = $null +$compatMode = $false # perfer utf-8 encoding if ($Global:IsWin) { - if (!$OutputEncoding -or $OutputEncoding.CodePage -ne 65001) { - $OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding + if (!$OutputEncoding -or $OutputEncoding.CodePage -ne 65001) { + $OutputEncoding = [System.Text.Encoding]::UTF8 + try { + [System.Console]::OutputEncoding = $OutputEncoding + } + catch { + $compatMode = $True + } } } +$ErrorActionPreference = @('Stop', 'Continue')[$compatMode] # import VersionEx and others . (Join-Path $PSScriptRoot 'extensions.ps1') @@ -1494,9 +1500,8 @@ function setup_gclient() { } # preprocess methods: -# -inputOptions [CMAKE_OPTIONS] -function preprocess_win([string[]]$inputOptions) { - $outputOptions = $inputOptions +function preprocess_win() { + $outputOptions = @() if ($options.sdk) { $outputOptions += "-DCMAKE_SYSTEM_VERSION=$($options.sdk)" @@ -1551,21 +1556,22 @@ function preprocess_win([string[]]$inputOptions) { # Generate mingw $Script:cmake_generator = 'Ninja Multi-Config' } - return $outputOptions + # refer: https://devblogs.microsoft.com/powershell/array-literals-in-powershell + return ,$outputOptions } -function preprocess_linux([string[]]$inputOptions) { - $outputOptions = $inputOptions +function preprocess_linux() { + $outputOptions = @() if ($Global:is_clang) { $outputOptions += '-DCMAKE_C_COMPILER=clang', '-DCMAKE_CXX_COMPILER=clang++' } - return $outputOptions + return ,$outputOptions } $ninja_prog = $null $is_gradlew = $options.xt.Contains('gradlew') -function preprocess_andorid([string[]]$inputOptions) { - $outputOptions = $inputOptions +function preprocess_andorid() { + $outputOptions = @() $t_archs = @{arm64 = 'arm64-v8a'; armv7 = 'armeabi-v7a'; x64 = 'x86_64'; x86 = 'x86'; } @@ -1605,11 +1611,11 @@ function preprocess_andorid([string[]]$inputOptions) { $outputOptions += '-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER' } - return $outputOptions + return ,$outputOptions } -function preprocess_osx([string[]]$inputOptions) { - $outputOptions = $inputOptions +function preprocess_osx() { + $outputOptions = @() $arch = $options.a if ($arch -eq 'x64') { $arch = 'x86_64' @@ -1619,12 +1625,12 @@ function preprocess_osx([string[]]$inputOptions) { if ($Global:target_minsdk) { $outputOptions += "-DCMAKE_OSX_DEPLOYMENT_TARGET=$Global:target_minsdk" } - return $outputOptions + return ,$outputOptions } # build ios famliy (ios,tvos,watchos) -function preprocess_ios([string[]]$inputOptions) { - $outputOptions = $inputOptions +function preprocess_ios() { + $outputOptions = @() $arch = $options.a if ($arch -eq 'x64') { $arch = 'x86_64' @@ -1642,12 +1648,11 @@ function preprocess_ios([string[]]$inputOptions) { $outputOptions += '-DSIMULATOR=TRUE' } } - return $outputOptions + return ,$outputOptions } -function preprocess_wasm([string[]]$inputOptions) { - if ($options.p -eq 'wasm64') { $inputOptions += '-DCMAKE_C_FLAGS="-Wno-experimental -sMEMORY64"', '-DCMAKE_CXX_FLAGS="-Wno-experimental -sMEMORY64"', '-DEMSCRIPTEN_SYSTEM_PROCESSOR=x86_64' } - return $inputOptions +function preprocess_wasm() { + return ,@() } function validHostAndToolchain() { @@ -1696,7 +1701,7 @@ function validHostAndToolchain() { } } -$proprocessTable = @{ +$preprocessTable = @{ 'win32' = ${function:preprocess_win}; 'winrt' = ${function:preprocess_win}; 'linux' = ${function:preprocess_linux}; @@ -1830,7 +1835,17 @@ if (!$setupOnly) { $1k.println("Building target $TARGET_OS on $HOST_OS_NAME with toolchain $TOOLCHAIN ...") # step1. preprocess cross make options - $CONFIG_ALL_OPTIONS = [array]$(& $proprocessTable[$TARGET_OS] -inputOptions @() ) + $CONFIG_ALL_OPTIONS = & $preprocessTable[$TARGET_OS] + + if (!$is_win_family) { + $cm_cflags = '-fPIC' + if ($TARGET_OS -eq 'wasm64') { + $cm_cflags += ' -sMEMORY64' + $CONFIG_ALL_OPTIONS += '-DEMSCRIPTEN_SYSTEM_PROCESSOR=x86_64', '-DCMAKE_CXX_FLAGS=-sMEMORY64' + } + + $CONFIG_ALL_OPTIONS += "-DCMAKE_C_FLAGS=$cm_cflags" + } if (!$CONFIG_ALL_OPTIONS) { $CONFIG_ALL_OPTIONS = @() diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 375c0d2e5a32..77d20d29ff26 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -17,7 +17,6 @@ option(AX_WITH_LLHTTP "Build with internal LLHTTP support" ON) # some libs not depended by axmol option(AX_WITH_LZ4 "Build with internal lz4 support" OFF) -option(AX_WITH_YAML_CPP "Build with yaml-cpp support" OFF) if(LINUX OR MACOSX OR WINDOWS) option(AX_WITH_DOCTEST "Build with doctest support" ON) @@ -458,20 +457,6 @@ if (AX_ENABLE_VLC_MEDIA AND (NOT _AX_HAVE_VLC)) ax_add_3rd(vlc TARGETS VLC::vlc;VLC::vlccore) endif() -# yaml -if(AX_WITH_YAML_CPP) - _1kfetch(yaml-cpp) - ax_add_3rd(${yaml-cpp_SOURCE_DIR} NO_LINK - TARGETS yaml-cpp - OPTIONS - "YAML_CPP_BUILD_TESTS OFF" - "YAML_CPP_BUILD_TOOLS OFF" - "YAML_CPP_BUILD_CONTRIB OFF" - "YAML_CPP_INSTALL OFF" - "YAML_CPP_CLANG_FORMAT_EXE OFF" - ) -endif() - if(AX_WITH_LZ4) if (NOT BUILD_SHARED_LIBS) set(lz4_tgt lz4_static) diff --git a/3rdparty/README.md b/3rdparty/README.md index ed7e9cc5f2ca..097534b5123a 100644 --- a/3rdparty/README.md +++ b/3rdparty/README.md @@ -247,11 +247,6 @@ - Version: 0.8.3 - License: BSD-2-Clause -## yaml-cpp -- [![Upstream](https://img.shields.io/github/v/release/jbeder/yaml-cpp?label=Upstream)](https://github.com/jbeder/yaml-cpp) -- Version: 0.8.0 -- License: MIT - ## yasio - [![Upstream](https://img.shields.io/github/v/release/yasio/yasio?label=Upstream)](https://github.com/yasio/yasio) - Version: 4.3.1 diff --git a/manifest.json b/manifest.json index 57d16236f12f..6db5d089df67 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,6 @@ "oboe": "1.9.3", "kcp": "v1.7-f2aa30e", "lz4": "v1.10.0", - "yaml-cpp": "0.8.0", "sample-assets": "master" }, "mirrors": { @@ -14,7 +13,6 @@ "oboe": "google/oboe.git", "kcp": "skywind3000/kcp.git", "lz4": "lz4/lz4.git", - "yaml-cpp": "jbeder/yaml-cpp.git", "sample-assets": "axmolengine/axmol-sample-assets.git", "axslcc": "axmolengine/axslcc/releases/download" }, @@ -25,7 +23,6 @@ "oboe": "simdsoft/oboe.git", "kcp": "simdsoft/kcp.git", "lz4": "simdsoft/lz4.git", - "yaml-cpp": "mirrors/yaml-cpp.git", "sample-assets": "simdsoft/axmol-sample-assets.git", "axslcc": "simdsoft/axslcc/releases/download" }