Skip to content

aui: add new package #7686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0e73f71
aui: add new packgage
luadebug Jul 18, 2025
2e08e66
Use exactly fmt 9.1.0 as in SRC
luadebug Jul 19, 2025
92f012e
Workaround lunasvg cmake that point to <lunasvg.h>
luadebug Jul 19, 2025
1e17fd3
fixup ws errors and prepend include folder
luadebug Jul 19, 2025
ae469fb
Disable precompiled download
luadebug Jul 19, 2025
ce1a9ff
Enforce AUI_STATIC definition
luadebug Jul 19, 2025
226bedf
try to fixup MSVC build
luadebug Jul 19, 2025
46df933
be generous, gift shell32 to windows/mingw
luadebug Jul 19, 2025
9d44439
try fix Windows@ARM64
luadebug Jul 19, 2025
d4ff764
fixup
luadebug Jul 19, 2025
d9e2e03
linux: fix pulse
luadebug Jul 19, 2025
5884cce
wrap into components
luadebug Jul 20, 2025
a88ec52
Merge branch 'xmake-io:dev' into aui
luadebug Jul 20, 2025
d9c3cff
fixup
luadebug Jul 20, 2025
e9cd03c
retry
luadebug Jul 20, 2025
5bb2a5d
fixup
luadebug Jul 20, 2025
75972c4
fixup
luadebug Jul 20, 2025
8346433
try improve windows shared build
luadebug Jul 22, 2025
8344da0
Add gtest to packagedeps along with glew to resolve Windows shared build
luadebug Jul 22, 2025
560c33b
https://aui-framework.github.io/develop/md_docs_2Runtime_01Dependency…
luadebug Jul 22, 2025
328f000
Try fix MacOS
luadebug Jul 22, 2025
f98d243
Add gtest to packagedeps for MacOS X
luadebug Jul 22, 2025
c1cbdd5
Update xmake.lua
luadebug Jul 22, 2025
84192d2
Do not store redundant arm64 windows implementation
luadebug Jul 22, 2025
17f26ed
split patch into component patches
luadebug Jul 23, 2025
552acec
use glm from pkg-conf
luadebug Jul 23, 2025
dce78aa
use INCLUDE_DIRS variable as INCLUDE_DIR is empty
luadebug Jul 23, 2025
942a871
Promote compile definition GLM_ENABLE_EXPERIMENTAL=1 to top level CMa…
luadebug Jul 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions packages/a/aui/patches/v7.1.2/debundle-audio.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
diff --git a/aui.audio/CMakeLists.txt b/aui.audio/CMakeLists.txt
index 21e44153..f6732e73 100644
--- a/aui.audio/CMakeLists.txt
+++ b/aui.audio/CMakeLists.txt
@@ -5,26 +5,44 @@ add_subdirectory(3rdparty/ogg)
aui_link(aui.audio PUBLIC aui::core)

if (AUI_PLATFORM_ANDROID)
- auib_import(oboe https://github.com/google/oboe ADD_SUBDIRECTORY VERSION main)
- aui_link(aui.audio PUBLIC oboe $<LINK_ONLY:log> $<LINK_ONLY:OpenSLES>)
+ if (AUIB_DISABLE)
+ find_package(oboe CONFIG REQUIRED)
+ aui_link(aui.audio PUBLIC oboe::oboe $<LINK_ONLY:log> $<LINK_ONLY:OpenSLES>)
+ else ()
+ auib_import(oboe https://github.com/google/oboe ADD_SUBDIRECTORY VERSION main)
+ aui_link(aui.audio PUBLIC oboe $<LINK_ONLY:log> $<LINK_ONLY:OpenSLES>)

- install(
- TARGETS oboe
- EXPORT aui
- ARCHIVE DESTINATION "aui.audio/lib"
- LIBRARY DESTINATION "aui.audio/lib"
- RUNTIME DESTINATION "aui.audio/bin"
- PUBLIC_HEADER DESTINATION "aui.audio/include"
- INCLUDES DESTINATION "aui.audio/include"
- )
+ install(
+ TARGETS oboe
+ EXPORT aui
+ ARCHIVE DESTINATION "aui.audio/lib"
+ LIBRARY DESTINATION "aui.audio/lib"
+ RUNTIME DESTINATION "aui.audio/bin"
+ PUBLIC_HEADER DESTINATION "aui.audio/include"
+ INCLUDES DESTINATION "aui.audio/include"
+ )
+ endif ()
elseif (AUI_PLATFORM_LINUX)
- aui_link(aui.audio PUBLIC pulse)
+ if (AUIB_DISABLE)
+ auib_use_system_libs_begin()
+ find_package(PkgConfig)
+ pkg_check_modules(PULSEAUDIO REQUIRED IMPORTED_TARGET libpulse)
+ aui_link(aui.audio PUBLIC PkgConfig::PULSEAUDIO)
+ auib_use_system_libs_end()
+ else ()
+ aui_link(aui.audio PUBLIC pulse)
+ endif ()
elseif (AUI_PLATFORM_WIN)
aui_link(aui.audio PUBLIC Winmm dsound.lib dxguid.lib)
endif()

-auib_import(Opus https://github.com/xiph/opus.git VERSION v1.4)
-aui_link(aui.audio PRIVATE Opus::opus)
+if (AUIB_DISABLE)
+ find_package(Opus CONFIG REQUIRED)
+ aui_link(aui.audio PRIVATE Opus::opus)
+else ()
+ auib_import(Opus https://github.com/xiph/opus.git VERSION v1.4)
+ aui_link(aui.audio PRIVATE Opus::opus)
+endif ()

if (AUI_PLATFORM_IOS OR AUI_PLATFORM_MACOS)
auib_use_system_libs_begin()
@@ -42,9 +60,15 @@ if (AUI_PLATFORM_MACOS)
"-framework QuartzCore")
endif()

-auib_import(soxr https://github.com/aui-framework/soxr
- ADD_SUBDIRECTORY
- VERSION adacc686124ac3568432f3dca388878963a005ee
- )
+if (AUIB_DISABLE)
+ include(FindPkgConfig)
+ pkg_check_modules(soxr REQUIRED IMPORTED_TARGET soxr)
+ aui_link(aui.audio PRIVATE PkgConfig::soxr)
+else ()
+ auib_import(soxr https://github.com/aui-framework/soxr
+ ADD_SUBDIRECTORY
+ VERSION adacc686124ac3568432f3dca388878963a005ee
+ )

-aui_link(aui.audio PRIVATE soxr)
+ aui_link(aui.audio PRIVATE soxr)
+endif ()
107 changes: 107 additions & 0 deletions packages/a/aui/patches/v7.1.2/debundle-build.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
diff --git a/cmake/aui.build.cmake b/cmake/aui.build.cmake
index 90c53d45..f980b2a3 100644
--- a/cmake/aui.build.cmake
+++ b/cmake/aui.build.cmake
@@ -218,23 +218,33 @@ function(aui_add_properties AUI_MODULE_NAME)
endfunction(aui_add_properties)

# gtest
-macro(_aui_import_gtest)
- if (NOT TARGET GTest::gtest)
- auib_import(GTest https://github.com/google/googletest
- VERSION v1.14.0
- CMAKE_ARGS -Dgtest_force_shared_crt=TRUE
- LINK STATIC)
- set_property(TARGET GTest::gtest PROPERTY IMPORTED_GLOBAL TRUE)
- set_property(TARGET GTest::gmock PROPERTY IMPORTED_GLOBAL TRUE)
- endif()
+macro(_aui_import_gtest AUIB_DISABLE)
+ if (AUIB_DISABLE)
+ find_package(gtest CONFIG REQUIRED)
+ get_target_property(GTEST_TARGET_IMPORTED_GLOBAL gtest::gtest IMPORTED_GLOBAL)
+ if (NOT GTEST_TARGET_IMPORTED_GLOBAL)
+ set_target_properties(gtest::gtest PROPERTIES IMPORTED_GLOBAL TRUE)
+ endif ()
+ find_package(gmock CONFIG REQUIRED)
+ get_target_property(GMOCK_TARGET_IMPORTED_GLOBAL gmock::gmock IMPORTED_GLOBAL)
+ if (NOT GMOCK_TARGET_IMPORTED_GLOBAL)
+ set_target_properties(gmock::gmock PROPERTIES IMPORTED_GLOBAL TRUE)
+ endif ()
+ else ()
+ if (NOT TARGET GTest::gtest)
+ auib_import(GTest https://github.com/google/googletest
+ VERSION v1.14.0
+ CMAKE_ARGS -Dgtest_force_shared_crt=TRUE
+ LINK STATIC)
+ set_property(TARGET GTest::gtest PROPERTY IMPORTED_GLOBAL TRUE)
+ set_property(TARGET GTest::gmock PROPERTY IMPORTED_GLOBAL TRUE)
+ endif()
+ endif ()
endmacro()

macro(aui_enable_tests AUI_MODULE_NAME)
if (NOT CMAKE_CROSSCOMPILING)
- _aui_import_gtest()
- if (NOT TARGET GTest::gtest)
- message(FATAL_ERROR "GTest::gtest not found!")
- endif()
+ _aui_import_gtest(ON)

enable_testing()
get_property(_source_dir TARGET ${AUI_MODULE_NAME} PROPERTY SOURCE_DIR)
@@ -268,7 +278,11 @@ macro(aui_enable_tests AUI_MODULE_NAME)
#gtest_add_tests(TARGET ${TESTS_MODULE_NAME})
set_property(TARGET ${TESTS_MODULE_NAME} PROPERTY CXX_STANDARD 20)
target_include_directories(${TESTS_MODULE_NAME} PUBLIC tests)
- target_link_libraries(${TESTS_MODULE_NAME} PUBLIC GTest::gmock)
+ if (AUIB_DISABLE)
+ target_link_libraries(${TESTS_MODULE_NAME} PUBLIC gmock::gmock)
+ else ()
+ target_link_libraries(${TESTS_MODULE_NAME} PUBLIC GTest::gmock)
+ endif ()

target_compile_definitions(${TESTS_MODULE_NAME} PUBLIC AUI_TESTS_MODULE=1)

@@ -317,20 +331,32 @@ endmacro()

# google benchmark

-macro(_aui_import_google_benchmark)
- if (NOT TARGET benchmark::benchmark)
- auib_import(benchmark https://github.com/google/benchmark
- VERSION v1.8.3
- CMAKE_ARGS -DBENCHMARK_ENABLE_GTEST_TESTS=OFF
- LINK STATIC)
- set_property(TARGET benchmark::benchmark PROPERTY IMPORTED_GLOBAL TRUE)
- endif()
+macro(_aui_import_google_benchmark AUIB_DISABLE)
+ if (AUIB_DISABLE)
+ find_package(benchmark CONFIG REQUIRED)
+ get_target_property(BENCHMARK_TARGET_IMPORTED_GLOBAL benchmark::benchmark IMPORTED_GLOBAL)
+ if (NOT BENCHMARK_TARGET_IMPORTED_GLOBAL)
+ set_target_properties(benchmark::benchmark PROPERTIES IMPORTED_GLOBAL TRUE)
+ endif ()
+ get_target_property(BENCHMARK_MAIN_TARGET_IMPORTED_GLOBAL benchmark::benchmark_main IMPORTED_GLOBAL)
+ if (NOT BENCHMARK_MAIN_TARGET_IMPORTED_GLOBAL)
+ set_target_properties(benchmark::benchmark_main PROPERTIES IMPORTED_GLOBAL TRUE)
+ endif ()
+ else ()
+ if (NOT TARGET benchmark::benchmark)
+ auib_import(benchmark https://github.com/google/benchmark
+ VERSION v1.8.3
+ CMAKE_ARGS -DBENCHMARK_ENABLE_GTEST_TESTS=OFF
+ LINK STATIC)
+ set_property(TARGET benchmark::benchmark PROPERTY IMPORTED_GLOBAL TRUE)
+ endif()
+ endif ()
endmacro()

macro(aui_enable_benchmarks AUI_MODULE_NAME)
if (NOT CMAKE_CROSSCOMPILING)
- _aui_import_gtest()
- _aui_import_google_benchmark()
+ _aui_import_gtest(ON)
+ _aui_import_google_benchmark(ON)
if (NOT TARGET benchmark::benchmark)
message(FATAL_ERROR "benchmark::benchmark not found!")
endif()
102 changes: 102 additions & 0 deletions packages/a/aui/patches/v7.1.2/debundle-core.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
diff --git a/aui.core/CMakeLists.txt b/aui.core/CMakeLists.txt
index 6aa1b07..a2f5149 100644
--- a/aui.core/CMakeLists.txt
+++ b/aui.core/CMakeLists.txt
@@ -6,12 +6,18 @@ option(AUI_ENABLE_ASAN "Enable AddressSanitizer" OFF)
option(AUI_ENABLE_DEATH_TESTS "Enable GTest death tests" ON)

aui_module(aui.core EXPORT aui)
-aui_enable_tests(aui.core)
+if (NOT AUIB_DISABLE)
+ aui_enable_tests(aui.core)
+endif ()
aui_enable_benchmarks(aui.core)


get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-if (GLM_INCLUDE_DIR)
+if (AUIB_DISABLE)
+ include(FindPkgConfig)
+ pkg_check_modules(GLM REQUIRED glm)
+ message(STATUS "Using pkg-config GLM_INCLUDE_DIRS: ${GLM_INCLUDE_DIRS}")
+elseif (GLM_INCLUDE_DIR)
message(STATUS "Using custom GLM_INCLUDE_DIR: ${GLM_INCLUDE_DIR}")
else()
set(GLM_INCLUDE_DIR "${SELF_DIR}/3rdparty/glm")
@@ -21,7 +27,7 @@ else()
DESTINATION "aui.core/include/"
)
endif()
-target_include_directories(aui.core PUBLIC $<BUILD_INTERFACE:${GLM_INCLUDE_DIR}>)
+target_include_directories(aui.core PUBLIC $<BUILD_INTERFACE:${GLM_INCLUDE_DIRS}>)

target_compile_definitions(aui.core PRIVATE UNICODE=1)
target_compile_definitions(aui.core PUBLIC NOMINMAX=1)
@@ -49,8 +55,12 @@ if (NOT WIN32)
endif()

if (AUI_PLATFORM_LINUX)
- auib_import(backtrace https://github.com/aui-framework/libbacktrace
- VERSION a5a32e3cc8e22a9fc40689a884b032c52ee3f88e)
+ if (AUIB_DISABLE)
+ find_package(libbacktrace CONFIG REQUIRED)
+ else ()
+ auib_import(backtrace https://github.com/aui-framework/libbacktrace
+ VERSION a5a32e3cc8e22a9fc40689a884b032c52ee3f88e)
+ endif ()
set(_use_backtrace TRUE)
else()

@@ -84,13 +94,17 @@ endif()

if(_use_backtrace)
message(STATUS "Stacktrace backend: backtrace")
- aui_link(aui.core PRIVATE backtrace)
+ if (AUIB_DISABLE)
+ aui_link(aui.core PRIVATE libbacktrace::libbacktrace)
+ else ()
+ aui_link(aui.core PRIVATE backtrace)
+ endif ()
target_compile_definitions(aui.core PRIVATE AUI_USE_BACKTRACE=1)
elseif(_use_unwind)
message(STATUS "Stacktrace backend: unwind")
target_compile_definitions(aui.core PRIVATE AUI_USE_UNWIND=1)
elseif(WIN32)
- aui_link(aui.core PRIVATE dbghelp shlwapi.lib)
+ aui_link(aui.core PRIVATE dbghelp shell32 shlwapi.lib)
message(STATUS "Stacktrace backend: dbghelp")
else()
message(STATUS "Stacktrace backend: none")
@@ -146,17 +160,23 @@ if (AUI_SHARED_PTR_FIND_INSTANCES)
endif()


-# [auib_import examples]
-auib_import(fmt https://github.com/fmtlib/fmt
- VERSION 9.1.0
- CMAKE_ARGS -DFMT_TEST=FALSE -DFMT_DOC=FALSE)
+if (AUIB_DISABLE)
+ find_package(fmt CONFIG REQUIRED)
+ find_package(range-v3 CONFIG REQUIRED)
+ aui_link(aui.core PUBLIC fmt::fmt range-v3::range-v3)
+else ()
+ # [auib_import examples]
+ auib_import(fmt https://github.com/fmtlib/fmt
+ VERSION 9.1.0
+ CMAKE_ARGS -DFMT_TEST=FALSE -DFMT_DOC=FALSE)

-auib_import(range-v3 https://github.com/ericniebler/range-v3
- VERSION 0.12.0
- CMAKE_ARGS -DRANGE_V3_DOCS=OFF -DRANGE_V3_TESTS=OFF -DRANGE_V3_EXAMPLES=OFF -DRANGE_V3_PERF=OFF -DRANGE_V3_HEADER_CHECKS=OFF)
-# [auib_import examples]
+ auib_import(range-v3 https://github.com/ericniebler/range-v3
+ VERSION 0.12.0
+ CMAKE_ARGS -DRANGE_V3_DOCS=OFF -DRANGE_V3_TESTS=OFF -DRANGE_V3_EXAMPLES=OFF -DRANGE_V3_PERF=OFF -DRANGE_V3_HEADER_CHECKS=OFF)
+ # [auib_import examples]

-aui_link(aui.core PUBLIC fmt::fmt-header-only range-v3::range-v3)
+ aui_link(aui.core PUBLIC fmt::fmt-header-only range-v3::range-v3)
+endif ()

# segfault functionality
if (NOT MSVC AND AUI_CATCH_UNHANDLED)
23 changes: 23 additions & 0 deletions packages/a/aui/patches/v7.1.2/debundle-crypt.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/aui.crypt/CMakeLists.txt b/aui.crypt/CMakeLists.txt
index c5354f2e..9c194be4 100644
--- a/aui.crypt/CMakeLists.txt
+++ b/aui.crypt/CMakeLists.txt
@@ -3,10 +3,16 @@ cmake_minimum_required(VERSION 3.10)

unset(OPENSSL_CRYPTO_LIBRARY CACHE)
unset(OPENSSL_SSL_LIBRARY CACHE)
-auib_import(OpenSSL https://github.com/aui-framework/openssl-cmake/archive/56ee19b7e11b418e0f29825414abdca96ff6b83e.zip ARCHIVE)
+if (AUIB_DISABLE)
+ find_package(OpenSSL CONFIG REQUIRED)
+else ()
+ auib_import(OpenSSL https://github.com/aui-framework/openssl-cmake/archive/56ee19b7e11b418e0f29825414abdca96ff6b83e.zip ARCHIVE)
+endif ()

aui_module(aui.crypt EXPORT aui)
-aui_enable_tests(aui.crypt)
+if (NOT AUIB_DISABLE)
+ aui_enable_tests(aui.crypt)
+endif ()
aui_link(aui.crypt PUBLIC aui::core)
target_include_directories(aui.crypt PRIVATE ${OPENSSL_INCLUDE_DIR})
aui_link(aui.crypt PRIVATE OpenSSL::SSL OpenSSL::Crypto)
23 changes: 23 additions & 0 deletions packages/a/aui/patches/v7.1.2/debundle-curl.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/aui.curl/CMakeLists.txt b/aui.curl/CMakeLists.txt
index 5141c8ee..00be58b4 100644
--- a/aui.curl/CMakeLists.txt
+++ b/aui.curl/CMakeLists.txt
@@ -1,9 +1,15 @@
cmake_minimum_required(VERSION 3.10)

-auib_import(CURL https://github.com/aui-framework/curl/archive/refs/heads/master.zip
- ARCHIVE)
+if (AUIB_DISABLE)
+ find_package(CURL CONFIG REQUIRED)
+else ()
+ auib_import(CURL https://github.com/aui-framework/curl/archive/refs/heads/master.zip
+ ARCHIVE)
+endif ()

aui_module(aui.curl EXPORT aui WHOLEARCHIVE)
-aui_enable_tests(aui.curl)
+if (NOT AUIB_DISABLE)
+ aui_enable_tests(aui.curl)
+endif ()
aui_link(aui.curl PUBLIC aui::core aui::json)
aui_link(aui.curl PRIVATE CURL::libcurl aui::crypt)
37 changes: 37 additions & 0 deletions packages/a/aui/patches/v7.1.2/debundle-image.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/aui.image/CMakeLists.txt b/aui.image/CMakeLists.txt
index 033e7ad5..1f8d8915 100644
--- a/aui.image/CMakeLists.txt
+++ b/aui.image/CMakeLists.txt
@@ -1,8 +1,12 @@
cmake_minimum_required(VERSION 3.10)

-auib_import(lunasvg https://github.com/aui-framework/lunasvg
- VERSION 272ceee)
+if (AUIB_DISABLE)
+ find_package(lunasvg CONFIG REQUIRED)
+else ()
+ auib_import(lunasvg https://github.com/aui-framework/lunasvg
+ VERSION 272ceee)

+endif ()

set(WEBP_COMPONENTS_TO_DISABLE ANIM_UTILS CWEBP DWEBP GIF2WEBP IMG2WEBP VWEBP WEBPINFO LIBWEBPMUX WEBPMUX EXTRAS)

@@ -10,9 +14,15 @@ foreach(_component ${WEBP_COMPONENTS_TO_DISABLE})
list(APPEND WEBP_CMAKE_ARGS "-DWEBP_BUILD_${_component}=OFF")
endforeach()

-auib_import(WebP https://github.com/webmproject/libwebp VERSION 1.3.1 CMAKE_ARGS ${WEBP_CMAKE_ARGS})
+if (AUIB_DISABLE)
+ find_package(WebP CONFIG REQUIRED)
+else ()
+ auib_import(WebP https://github.com/webmproject/libwebp VERSION 1.3.1 CMAKE_ARGS ${WEBP_CMAKE_ARGS})
+endif ()

aui_module(aui.image WHOLEARCHIVE EXPORT aui)
add_subdirectory(3rdparty)
aui_link(aui.image PRIVATE aui::core lunasvg::lunasvg WebP::webp WebP::webpdemux)
-aui_enable_tests(aui.image)
+if (NOT AUIB_DISABLE)
+ aui_enable_tests(aui.image)
+endif ()
Loading
Loading