Skip to content

Commit cb33556

Browse files
authored
Improve NuGet package management (#2671)
* Download packages into Axmol's cache directory
1 parent 32599b2 commit cb33556

File tree

13 files changed

+58
-31
lines changed

13 files changed

+58
-31
lines changed

1k/build.profiles

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ axslcc=1.9.6+
1010

1111
# The cmake, @gradle @axmol-cmdline
1212
# as latest as possible
13-
cmake=3.30.0~4.1.0+
13+
cmake=3.30.0~4.1.1+
1414

1515
# The ninja
1616
ninja=1.10.0~1.12.1+

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
## Bug fixes
44

5+
- Fix #2669: Windows UWP not running on Windows 11 due to DriverGL initialization failure by @halx99
6+
- Fix #2655: Multi-touch not work on android scene contains imgui layer by @halx99
57
- Fix incorrect FontAtlas when switching label rendering mode from normal to SDF by @halx99 in https://github.com/axmolengine/axmol/pull/2629
68
- Fix wasm Device::getTextureDataForText will report exception when process whitespace text by @halx99
79
- Fix linux label color incorrect when LabelType is STRING_TEXTURE by @halx99
810
- Fix incorrect fmt::format_to use case by @halx99 in https://github.com/axmolengine/axmol/pull/2612
911
- Fix llvm ver trim in genbindings.ps1 by @halx99
1012
- Fix Label SDF rendering issues with font resizing and other bugs by @halx99 in https://github.com/axmolengine/axmol/pull/2625
13+
- Fix compile error when project contains swift code by @halx99 in https://github.com/axmolengine/axmol/pull/2632
14+
- Fix wasm Downloader open file with wrong permision (#2666) by @AlexandreK38 in https://github.com/axmolengine/axmol/pull/2666
15+
- Fix failure in CMake 4.1 when targeting Windows: assembler not found by @halx99
1116

1217
## Improvements
1318

@@ -24,12 +29,17 @@
2429
- Use pragma once for more header files by @halx99 in https://github.com/axmolengine/axmol/pull/2616
2530
- Add support set window size limits by @NgVThangBz in https://github.com/axmolengine/axmol/pull/2618
2631
- Renamed cpp-tests "Node: Label - New API" to "Node: Label" by @aismann in https://github.com/axmolengine/axmol/pull/2627
32+
- Update ImGui mult-viewports hint message by @halx99
33+
- Improve tests (Naming of menu entries on cpp-/lua- tests) by @aismann in https://github.com/axmolengine/axmol/pull/2640
34+
- Move SIMD availability detection into its own CMake file by @j-jorge in https://github.com/axmolengine/axmol/pull/2642
35+
- Setting CMAKE_MSVC_DEBUG_INFORMATION_FORMAT to Embedded to resolve pdb too large problem by @halx99
36+
- Improve NuGet package management by @halx99 in https://github.com/axmolengine/axmol/pull/2671
2737

2838
## SDK & Tools updates
2939

3040
- agp: 8.11.0 => 8.11.1
3141
- gradle: 8.14.3 => 9.0.0
32-
- cmake: 4.0.3 => 4.1.0
42+
- cmake: 4.0.3 => 4.1.1
3343

3444
## 3rdparty updates
3545

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
# build engine library and all tests
2929

30-
cmake_minimum_required(VERSION 3.22...4.0)
30+
cmake_minimum_required(VERSION 3.22...4.1)
3131

3232
project(axmol)
3333

CMakeOptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
- win32: whether use ANGLE GLES backend
4242
- osx: whether use OpenGL instead Metal backend
4343
- ios/tvos: whether use GLES instead Metal backend
44-
- AX_CORE_PROFILE: whether strip all deprecated features, default `FALSE`, it's useful to pre-upgrade your game project to adapte future axmol versions
44+
- AX_CORE_PROFILE: whether strip all deprecated features, default `FALSE`, Setting this to `TRUE` before upgrading your game project helps ensure compatibility with future Axmol versions.
4545
- AX_ISA_LEVEL: specifiy SIMD Instructions Acceleration Level: 0~4, 0: disabled, 1: SSE2, 2: SSE4.1/NEON, 3: SSE4.2, 4: AVX2, default: 2
4646
- AX_GLES_PROFILE: specify GLES profile version for GLES backend, valid value `200`, `300`
4747
- AX_WASM_THREADS: specify wasm thread count, valid value: number: `>=0` , string: must be: `auto` or `navigator.hardwareConcurrency`(default),

INFRA.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
# The axmol sdk & tools references
22

3-
## cppwinrt
3+
## Microsoft.Windows.CppWinRT
44

5-
- [![Upstream](https://img.shields.io/github/v/release/microsoft/cppwinrt?label=Upstream)](https://github.com/microsoft/cppwinrt)
5+
- [![nuget](https://img.shields.io/nuget/v/Microsoft.Windows.CppWinRT?label=Upstream)](https://www.nuget.org/packages/Microsoft.Windows.CppWinRT)
66
- Version: 2.0.250303.1
77
- License: MIT
88
- Platform: WinRT/WinUWP
99
- Manged by: `cmake/Modules/AXConfigDefine.cmake`
1010

11+
## Microsoft.Web.WebView2
12+
13+
- [![nuget](https://img.shields.io/nuget/v/Microsoft.Web.WebView2?label=Upstream)](https://www.nuget.org/packages/Microsoft.Web.WebView2)
14+
- Version: 1.0.3045.78
15+
- License: https://www.nuget.org/packages/Microsoft.Web.WebView2/1.0.3405.78/License
16+
- Platform: Win32
17+
- Managed by: `cmake/Modules/AXConfigDefine.cmake`
18+
1119
## gradle
1220

13-
- [![Upstream](https://img.shields.io/github/v/release/gradle/gradle?label=Upstream)](https://github.com/gradle/gradle)
21+
- [![github](https://img.shields.io/github/v/release/gradle/gradle?label=Upstream)](https://github.com/gradle/gradle)
1422
- Version: 9.0.0
1523
- License: Apache-2.0
1624
- Platform: Android

cmake/CppWinRT.props.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<!-- CppWinRT.props for Axmol Universal Apps -->
3-
<Import Project="@AX_TOP_SOLUTION_DIR@\packages\Microsoft.Windows.CppWinRT\build\native\Microsoft.Windows.CppWinRT.props" />
3+
<Import Project="@_NUGET_PACKAGE_DIR_N@\Microsoft.Windows.CppWinRT\build\native\Microsoft.Windows.CppWinRT.props" />
44
<ItemGroup>
55
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp" />
66
</ItemGroup>

cmake/Modules/AXBuildHelpers.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function(ax_sync_target_dlls ax_target)
243243
if(CMAKE_GENERATOR MATCHES "Ninja")
244244
add_custom_command(TARGET ${ax_target} POST_BUILD
245245
COMMAND ${CMAKE_COMMAND} -E copy_if_different
246-
"${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll"
246+
"${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll"
247247
$<TARGET_FILE_DIR:${ax_target}>)
248248
endif()
249249
endif()
@@ -609,7 +609,7 @@ macro(ax_setup_app_props app_name)
609609
VS_GLOBAL_AppContainerApplication true
610610
VS_GLOBAL_RootNameSpace "AxmolAppWinRT" # this is important for cppwinrt to fix Generated Files\XamlMetaDataProvider.idl(4): error MIDL2025: [msg]syntax error [context]: expecting NamespaceTag near "{"
611611
)
612-
target_link_libraries(${APP_NAME} ${CMAKE_BINARY_DIR}/packages/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.targets)
612+
target_link_libraries(${APP_NAME} ${_NUGET_PACKAGE_DIR}/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.targets)
613613
elseif(WASM)
614614
get_target_property(_APP_SOURCE_DIR ${app_name} SOURCE_DIR)
615615
set(CMAKE_EXECUTABLE_SUFFIX ".html")

cmake/Modules/AXConfigDefine.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ if(MSVC)
1313
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
1414
endif()
1515

16+
if(WINDOWS)
17+
set(_NUGET_PACKAGE_DIR "${_AX_ROOT}/cache/packages" CACHE INTERNAL "" FORCE)
18+
file(TO_NATIVE_PATH ${_NUGET_PACKAGE_DIR} _NUGET_PACKAGE_DIR_N)
19+
set(_NUGET_PACKAGE_DIR_N "${_NUGET_PACKAGE_DIR_N}" CACHE INTERNAL "" FORCE)
20+
endif()
21+
1622
# UWP min deploy target support, VS property: targetPlatformMinVersion
1723
if(WINRT)
1824
# The minmal deploy target version: Windows 10, version 1809 (Build 10.0.17763) for building msix package
@@ -23,6 +29,8 @@ if(WINRT)
2329
# For axmol deprecated policy, we need disable /sdl checks explicitly to avoid compiler traits invoking deprecated functions as error
2430
set(CMAKE_C_FLAGS "/sdl- ${CMAKE_C_FLAGS}")
2531
set(CMAKE_CXX_FLAGS "/sdl- ${CMAKE_CXX_FLAGS}")
32+
elseif(WIN32)
33+
set(AX_MSEDGE_WEBVIEW2_VERSION "1.0.3405.78" CACHE STRING "")
2634
endif()
2735

2836
# config c standard
@@ -278,6 +286,7 @@ if(MSVC)
278286
else()
279287
enable_language(ASM OPTIONAL)
280288
endif()
289+
281290
enable_language(ASM_NASM OPTIONAL)
282291

283292
# we don't need cmake BUILD_TESTING feature

cmake/Modules/AXLinkHelpers.cmake

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
2323
# stupid: exclude CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG to avoid cmake generate
2424
# .vcxproj with incorrect debug msvc runtime, should be /MDd but got /MD
2525
set(AXSLCC_OUT_DIR_PROJ "${AXSLCC_OUT_DIR}")
26-
load_cache("${AX_ROOT_DIR}/${AX_PREBUILT_DIR}" EXCLUDE thirdparty_LIB_DEPENDS CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG)
26+
load_cache("${AX_ROOT_DIR}/${AX_PREBUILT_DIR}" INCLUDE_INTERNALS _NUGET_PACKAGE_DIR EXCLUDE thirdparty_LIB_DEPENDS CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG)
2727
set(AXSLCC_OUT_DIR_ENGINE ${AXSLCC_OUT_DIR})
2828
set(AXSLCC_OUT_DIR "${AXSLCC_OUT_DIR_PROJ}" CACHE STRING "" FORCE)
2929
unset(AXSLCC_OUT_DIR_PROJ)
@@ -44,6 +44,7 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
4444
message(STATUS "AX_ENABLE_EXT_EFFEKSEER=${AX_ENABLE_EXT_EFFEKSEER}")
4545
message(STATUS "AX_ENABLE_EXT_LUA=${AX_ENABLE_EXT_LUA}")
4646
message(STATUS "AX_ENABLE_EXT_DRAWNODEEX=${AX_ENABLE_EXT_DRAWNODEEX}")
47+
message(STATUS "_NUGET_PACKAGE_DIR=${_NUGET_PACKAGE_DIR}")
4748

4849
# compile defines can't inherit when link prebuits, so need add manually
4950
target_compile_definitions(${APP_NAME}
@@ -262,24 +263,24 @@ function(ax_link_cxx_prebuilt APP_NAME AX_ROOT_DIR AX_PREBUILT_DIR)
262263
if(AX_GLES_PROFILE)
263264
add_custom_command(TARGET ${APP_NAME} POST_BUILD
264265
COMMAND ${CMAKE_COMMAND} -E copy_if_different
265-
${AX_ROOT_DIR}/3rdparty/angle/_x/lib/${PLATFORM_NAME}/${ARCH_ALIAS}/libGLESv2.dll
266-
${AX_ROOT_DIR}/3rdparty/angle/_x/lib/${PLATFORM_NAME}/${ARCH_ALIAS}/libEGL.dll
267-
${AX_ROOT_DIR}/3rdparty/angle/_x/lib/${PLATFORM_NAME}/${ARCH_ALIAS}/d3dcompiler_47.dll
266+
"${AX_ROOT_DIR}/3rdparty/angle/_x/lib/${PLATFORM_NAME}/${ARCH_ALIAS}/libGLESv2.dll"
267+
"${AX_ROOT_DIR}/3rdparty/angle/_x/lib/${PLATFORM_NAME}/${ARCH_ALIAS}/libEGL.dll"
268+
"${AX_ROOT_DIR}/3rdparty/angle/_x/lib/${PLATFORM_NAME}/${ARCH_ALIAS}/d3dcompiler_47.dll"
268269
$<TARGET_FILE_DIR:${APP_NAME}>
269270
)
270271
endif()
271272

272273
if(AX_ENABLE_MSEDGE_WEBVIEW2)
273274
if(CMAKE_GENERATOR MATCHES "Ninja")
274-
target_link_libraries(${APP_NAME} ${AX_ROOT_DIR}/${AX_PREBUILT_DIR}/packages/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll.lib)
275-
target_include_directories(${APP_NAME} PRIVATE ${AX_ROOT_DIR}/${AX_PREBUILT_DIR}/packages/Microsoft.Web.WebView2/build/native/include)
275+
target_link_libraries(${APP_NAME} "${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll.lib")
276+
target_include_directories(${APP_NAME} PRIVATE "${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/include")
276277
add_custom_command(TARGET ${APP_NAME} POST_BUILD
277278
COMMAND ${CMAKE_COMMAND} -E copy_if_different
278-
"${AX_ROOT_DIR}/${AX_PREBUILT_DIR}/packages/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll"
279+
"${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll"
279280
$<TARGET_FILE_DIR:${APP_NAME}>
280281
)
281282
else()
282-
target_link_libraries(${APP_NAME} ${AX_ROOT_DIR}/${AX_PREBUILT_DIR}/packages/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets)
283+
target_link_libraries(${APP_NAME} "${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets")
283284
endif()
284285
endif()
285286
endif()

core/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# include_guard (GLOBAL)
3333

3434
# The version number
35-
set(_AX_VERSION 2.7)
35+
set(_AX_VERSION 2.8)
3636

3737
if(NOT DEFINED _AX_CORE_LIB)
3838
set(_AX_CORE_LIB axmol CACHE INTERNAL "The axmol core lib name")
@@ -409,27 +409,26 @@ if(WINDOWS)
409409
endif()
410410

411411
if(WINDOWS_STORE)
412-
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} AX_TOP_SOLUTION_DIR)
413412
configure_file(${_AX_ROOT}/cmake/CppWinRT.props.in ${CMAKE_BINARY_DIR}/CppWinRT.props @ONLY)
414413

415414
# intsall cppwinrt package for xaml apps
416415
execute_process(COMMAND "${NUGET_EXE}"
417-
install "Microsoft.Windows.CppWinRT" -Version ${AX_CPPWINRT_VERSION} -ExcludeVersion -OutputDirectory "${CMAKE_BINARY_DIR}/packages")
416+
install "Microsoft.Windows.CppWinRT" -Version ${AX_CPPWINRT_VERSION} -ExcludeVersion -OutputDirectory "${_NUGET_PACKAGE_DIR}")
418417
set_target_properties(${_AX_CORE_LIB} PROPERTIES
419-
VS_PROJECT_IMPORT ${CMAKE_BINARY_DIR}/packages/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.props
418+
VS_PROJECT_IMPORT ${_NUGET_PACKAGE_DIR}/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.props
420419
)
421-
target_link_libraries(${_AX_CORE_LIB} ${CMAKE_BINARY_DIR}/packages/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.targets)
420+
target_link_libraries(${_AX_CORE_LIB} ${_NUGET_PACKAGE_DIR}/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.targets)
422421
endif()
423422

424423
if(AX_ENABLE_MSEDGE_WEBVIEW2)
425424
execute_process(COMMAND "${NUGET_EXE}"
426-
install "Microsoft.Web.WebView2" -Version 1.0.992.28 -ExcludeVersion -OutputDirectory "${CMAKE_BINARY_DIR}/packages")
425+
install "Microsoft.Web.WebView2" -Version ${AX_MSEDGE_WEBVIEW2_VERSION} -ExcludeVersion -OutputDirectory "${_NUGET_PACKAGE_DIR}")
427426

428427
if(CMAKE_GENERATOR MATCHES "Ninja")
429-
target_link_libraries(${_AX_CORE_LIB} ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll.lib)
430-
target_include_directories(${_AX_CORE_LIB} PUBLIC ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/include)
428+
target_link_libraries(${_AX_CORE_LIB} ${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/${ARCH_ALIAS}/WebView2Loader.dll.lib)
429+
target_include_directories(${_AX_CORE_LIB} PUBLIC ${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/include)
431430
else()
432-
target_link_libraries(${_AX_CORE_LIB} ${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets)
431+
target_link_libraries(${_AX_CORE_LIB} ${_NUGET_PACKAGE_DIR}/Microsoft.Web.WebView2/build/native/Microsoft.Web.WebView2.targets)
433432
endif()
434433
endif()
435434
endif()

0 commit comments

Comments
 (0)