Skip to content

Commit

Permalink
Remove unused 3rd lib: yaml-cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Jan 26, 2025
1 parent 4097554 commit c0f82f9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 48 deletions.
65 changes: 40 additions & 25 deletions 1k/1kiss.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down Expand Up @@ -1494,9 +1500,8 @@ function setup_gclient() {
}

# preprocess methods:
# <param>-inputOptions</param> [CMAKE_OPTIONS]
function preprocess_win([string[]]$inputOptions) {
$outputOptions = $inputOptions
function preprocess_win() {
$outputOptions = @()

if ($options.sdk) {
$outputOptions += "-DCMAKE_SYSTEM_VERSION=$($options.sdk)"
Expand Down Expand Up @@ -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() {

This comment has been minimized.

Copy link
@paulocoutinhox

paulocoutinhox Jan 27, 2025

Contributor

please, fix the type "andorid" to "android"

$outputOptions = @()

$t_archs = @{arm64 = 'arm64-v8a'; armv7 = 'armeabi-v7a'; x64 = 'x86_64'; x86 = 'x86'; }

Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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() {
Expand Down Expand Up @@ -1696,7 +1701,7 @@ function validHostAndToolchain() {
}
}

$proprocessTable = @{
$preprocessTable = @{
'win32' = ${function:preprocess_win};
'winrt' = ${function:preprocess_win};
'linux' = ${function:preprocess_linux};
Expand Down Expand Up @@ -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 = @()
Expand Down
15 changes: 0 additions & 15 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions 3rdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
},
Expand All @@ -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"
}
Expand Down

0 comments on commit c0f82f9

Please sign in to comment.