Skip to content

Commit

Permalink
Merge branch 'axmolengine:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 authored Jan 19, 2024
2 parents 000d4d0 + 8ee68b5 commit 57e987f
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 69 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: publish

on:
workflow_run:
workflows: [build]
types: [completed]
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
Expand Down
96 changes: 46 additions & 50 deletions 1k/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1578,10 +1578,9 @@ if (!$setupOnly) {
$b1k.println("CONFIG_ALL_OPTIONS=$CONFIG_ALL_OPTIONS, Count={0}" -f $CONFIG_ALL_OPTIONS.Count)

if ($Global:is_android -and $is_gradlew) {
$storedLocation = (Get-Location).Path
$build_tool = (Get-Command $options.xt).Source
$build_tool_dir = Split-Path $build_tool -Parent
Set-Location $build_tool_dir
Push-Location $build_tool_dir
if (!$configOnly) {
if ($optimize_flag -eq 'Debug') {
& $build_tool assembleDebug $CONFIG_ALL_OPTIONS | Out-Host
Expand All @@ -1593,65 +1592,64 @@ if (!$setupOnly) {
else {
& $build_tool tasks
}
Set-Location $storedLocation
Pop-Location
}
else {
# step3. configure

$workDir = $(Get-Location).Path

$mainDep = Join-Path $workDir 'CMakeLists.txt'
if (!$b1k.isfile($mainDep)) {
$b1k.println("Missing CMakeLists.txt in $workDir")
Set-Location $stored_cwd
return
}

$mainDepChanged = $false
# A Windows file time is a 64-bit value that represents the number of 100-nanosecond
$tempFileItem = Get-Item $mainDep
$lastWriteTime = $tempFileItem.LastWriteTime.ToFileTimeUTC()
$tempFile = Join-Path $BUILD_DIR 'b1k_cache.txt'

$storeHash = 0
if ($b1k.isfile($tempFile)) {
$storeHash = Get-Content $tempFile -Raw
}
$hashValue = $b1k.hash("$CONFIG_ALL_OPTIONS#$lastWriteTime")
$mainDepChanged = "$storeHash" -ne "$hashValue"
$cmakeCachePath = $b1k.realpath("$BUILD_DIR/CMakeCache.txt")

if ($mainDepChanged -or !$b1k.isfile($cmakeCachePath) -or $forceConfig) {
if (!$is_wasm) {
cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
if ($b1k.isfile($mainDep)) {
$mainDepChanged = $false
# A Windows file time is a 64-bit value that represents the number of 100-nanosecond
$tempFileItem = Get-Item $mainDep
$lastWriteTime = $tempFileItem.LastWriteTime.ToFileTimeUTC()
$tempFile = Join-Path $BUILD_DIR 'b1k_cache.txt'

$storeHash = 0
if ($b1k.isfile($tempFile)) {
$storeHash = Get-Content $tempFile -Raw
}
else {
emcmake cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
}
Set-Content $tempFile $hashValue -NoNewline
}
$hashValue = $b1k.hash("$CONFIG_ALL_OPTIONS#$lastWriteTime")
$mainDepChanged = "$storeHash" -ne "$hashValue"
$cmakeCachePath = $b1k.realpath("$BUILD_DIR/CMakeCache.txt")

if (!$configOnly) {
if (!$is_engine) {
if (!$b1k.isfile($cmakeCachePath)) {
throw "The cmake generate incomplete, pelase add '-f' to re-generate again"
if ($mainDepChanged -or !$b1k.isfile($cmakeCachePath) -or $forceConfig) {
if (!$is_wasm) {
cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
}
else {
emcmake cmake -B $BUILD_DIR $CONFIG_ALL_OPTIONS | Out-Host
}
Set-Content $tempFile $hashValue -NoNewline
}

# step4. build
# apply additional build options
$BUILD_ALL_OPTIONS += "--parallel"
if ($Global:is_linux) {
$BUILD_ALL_OPTIONS += "$(nproc)"
}
if (($cmake_generator -eq 'Xcode') -and ($BUILD_ALL_OPTIONS.IndexOf('--verbose') -eq -1)) {
$BUILD_ALL_OPTIONS += '--', '-quiet'
}
$b1k.println("BUILD_ALL_OPTIONS=$BUILD_ALL_OPTIONS, Count={0}" -f $BUILD_ALL_OPTIONS.Count)
if (!$configOnly) {
if (!$is_engine) {
if (!$b1k.isfile($cmakeCachePath)) {
Set-Location $stored_cwd
throw "The cmake generate incomplete, pelase add '-f' to re-generate again"
}
}

cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS | Out-Host
# step4. build
# apply additional build options
$BUILD_ALL_OPTIONS += "--parallel"
if ($Global:is_linux) {
$BUILD_ALL_OPTIONS += "$(nproc)"
}
if (($cmake_generator -eq 'Xcode') -and ($BUILD_ALL_OPTIONS.IndexOf('--verbose') -eq -1)) {
$BUILD_ALL_OPTIONS += '--', '-quiet'
}
$b1k.println("BUILD_ALL_OPTIONS=$BUILD_ALL_OPTIONS, Count={0}" -f $BUILD_ALL_OPTIONS.Count)

cmake --build $BUILD_DIR $BUILD_ALL_OPTIONS | Out-Host
}
} else {
$b1k.println("Missing CMakeLists.txt in $workDir")
}
}

Set-Location $stored_cwd
} else {
# google gclient/gn build system
# refer: https://chromium.googlesource.com/chromium/src/+/eca97f87e275a7c9c5b7f13a65ff8635f0821d46/tools/gn/docs/reference.md#args_specifies-build-arguments-overrides-examples
Expand Down Expand Up @@ -1730,7 +1728,5 @@ if (!$setupOnly) {
isHostTarget = $is_host_target
compilerID = $TOOLCHAIN_NAME
}

Set-Location $stored_cwd
}

4 changes: 2 additions & 2 deletions cmake/Modules/AXPlatform.cmake → 1k/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ elseif(CMAKE_GENERATOR MATCHES Visual)
set(VS TRUE)
endif()

function(ax_check_archs)
function(_1k_deprecated_32bit project_name release_ver)
if(("${ARCH_ALIAS}" MATCHES "x86") OR ("${ARCH_ALIAS}" MATCHES "armeabi-v7a"))
message(WARNING "Building 32-bit[${ARCH_ALIAS}] axmol is deprecated, and will be removed in next release axmol-2.2.0")
message(WARNING "Building 32-bit[${ARCH_ALIAS}] ${project_name} is deprecated, and will be removed in next release ${release_ver}")
endif()
endfunction()
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
- KEY_STORE_PASSWORD ==> KEY_STORE_PASSWORD
- RELEASE_KEY_ALIAS ==> KEY_ALIAS
- RELEASE_KEY_PASSWORD ==> KEY_PASSWORD
- Enable template projects' `aidl` by default for In-app purchases by @armanhossiny

### Break changes

Expand Down
3 changes: 2 additions & 1 deletion cmake/Modules/AXBuildSet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ include(AXConfigDefine)
# config libraries dependence
include(AXConfigDepend)

message(AUTHOR_WARNING "CMAKE_VERSION:" ${CMAKE_VERSION})
message(STATUS "CMAKE_HOST_SYSTEM_NAME:" ${CMAKE_HOST_SYSTEM_NAME})
message(STATUS "CMAKE_SYSTEM_NAME:" ${CMAKE_SYSTEM_NAME})
message(STATUS "CMAKE_GENERATOR_PLATFORM:" ${CMAKE_GENERATOR_PLATFORM})
Expand All @@ -65,4 +66,4 @@ message(STATUS "PROJECT_BINARY_DIR:" ${PROJECT_BINARY_DIR})
message(STATUS "ENGINE_BINARY_PATH:" ${ENGINE_BINARY_PATH})
message(STATUS "ARCH_ALIAS:" ${ARCH_ALIAS})

ax_check_archs()
_1k_deprecated_32bit(axmol 2.2.0)
3 changes: 1 addition & 2 deletions cmake/Modules/AXConfigDefine.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

include(AXPlatform)
include(${_AX_ROOT}/1k/platform.cmake)

# custom target property for lua/js link
define_property(TARGET
Expand Down
5 changes: 2 additions & 3 deletions cmake/Modules/AXLinkHelpers.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include(AXPlatform)

ax_check_archs()
include(${_AX_ROOT}/1k/platform.cmake)
_1k_deprecated_32bit(axmol 2.2.0)

if(NOT CMAKE_GENERATOR MATCHES "Ninja")
set(BUILD_CONFIG_DIR "\$\(Configuration\)/")
Expand Down
4 changes: 4 additions & 0 deletions templates/cpp-template-default/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ android {
aaptOptions {
noCompress 'mp3','ogg','wav','mp4','ttf','ttc'
}

buildFeatures {
aidl true
}
}

android.applicationVariants.configureEach { variant ->
Expand Down
4 changes: 4 additions & 0 deletions templates/lua-template-default/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ android {
aaptOptions {
noCompress 'mp3','ogg','wav','mp4','ttf','ttc'
}

buildFeatures {
aidl true
}
}

android.applicationVariants.configureEach { variant ->
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/angle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(lib_name angle)

project(${lib_name})

_1kfetch_dist(angle "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(angle)

if(WINRT)
# -----macro: set openssl sub target-----
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/c-ares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(target_name c-ares)

project(${target_name})

_1kfetch_dist(cares "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(cares)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/curl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(target_name ${lib_name})

project(${lib_name})

_1kfetch_dist(curl "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(curl)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/jpeg-turbo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(target_name ${lib_name})

project(${lib_name})

_1kfetch_dist(jpeg-turbo "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(jpeg-turbo)

add_library(${target_name} STATIC IMPORTED GLOBAL)

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/lua/luajit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(lib_name luajit)
set(target_name ${lib_name})
project(${lib_name})

_1kfetch_dist(luajit "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(luajit)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/openssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(lib_name openssl)

project(${lib_name})

_1kfetch_dist(openssl "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(openssl)

set(OPENSSL_INCLUDE_DIR "${openssl_INC_DIR}" CACHE STRING "OpenSSL include dir" FORCE)

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(target_name "zlib")
project(${target_name})

_1kfetch_dist(zlib "${PARENT_DIRECTORY}/_deps")
_1kfetch_dist(zlib)

if(WINDOWS)
add_library(${target_name} SHARED IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion tools/console/axmol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@ if ($args[0] -eq 'new') {
}
}

. $plugin.proc @sub_args @sub_opts
. $plugin.proc $sub_args @sub_opts

0 comments on commit 57e987f

Please sign in to comment.