浏览代码

aui: add new package (#7686)

* aui: add new packgage

* Use exactly fmt 9.1.0 as in SRC

* Workaround lunasvg cmake that point to <lunasvg.h>

* fixup ws errors and prepend include folder

* Disable precompiled download

* Enforce AUI_STATIC definition

* try to fixup MSVC build

* be generous, gift shell32 to windows/mingw

* try fix Windows@ARM64

* fixup

* linux: fix pulse

* wrap into components

* fixup

* retry

* fixup

* fixup

* try improve windows shared build

* Add gtest to packagedeps along with glew to resolve Windows shared build

* https://aui-framework.github.io/develop/md_docs_2Runtime_01Dependency_01Resolution.html
Disable runtime dependency resolution

* Try fix MacOS

* Add gtest to packagedeps for MacOS X

* Update xmake.lua

* Do not store redundant arm64 windows implementation

* split patch into component patches

* use glm from pkg-conf

* use INCLUDE_DIRS variable as INCLUDE_DIR is empty

* Promote compile definition GLM_ENABLE_EXPERIMENTAL=1 to top level CMake & use package defines to keep it
Saikari 1 月之前
父节点
当前提交
95a8b467a3

+ 84 - 0
packages/a/aui/patches/v7.1.2/debundle-audio.diff

@@ -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 - 0
packages/a/aui/patches/v7.1.2/debundle-build.diff

@@ -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 - 0
packages/a/aui/patches/v7.1.2/debundle-core.diff

@@ -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 - 0
packages/a/aui/patches/v7.1.2/debundle-crypt.diff

@@ -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 - 0
packages/a/aui/patches/v7.1.2/debundle-curl.diff

@@ -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 - 0
packages/a/aui/patches/v7.1.2/debundle-image.diff

@@ -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 ()

+ 29 - 0
packages/a/aui/patches/v7.1.2/debundle-json-network.diff

@@ -0,0 +1,29 @@
+diff --git a/aui.json/CMakeLists.txt b/aui.json/CMakeLists.txt
+index d0190bd5..980456da 100644
+--- a/aui.json/CMakeLists.txt
++++ b/aui.json/CMakeLists.txt
+@@ -3,7 +3,9 @@ cmake_minimum_required(VERSION 3.10)
+ aui_module(aui.json EXPORT aui)
+ 
+ aui_link(aui.json PRIVATE aui::core)
+-aui_enable_tests(aui.json)
++if (NOT AUIB_DISABLE)
++    aui_enable_tests(aui.json)
++endif ()
+ aui_enable_benchmarks(aui.json)
+ if (TARGET Benchmarks)
+     # curl needed to download the benchmark data
+diff --git a/aui.network/CMakeLists.txt b/aui.network/CMakeLists.txt
+index bb668703..1f85acd3 100644
+--- a/aui.network/CMakeLists.txt
++++ b/aui.network/CMakeLists.txt
+@@ -9,4 +9,6 @@ if(WIN32)
+   target_compile_definitions(aui.network PRIVATE PIO_APC_ROUTINE_DEFINED=1)
+ endif()
+ 
+-aui_enable_tests(aui.network)
+\ No newline at end of file
++if (NOT AUIB_DISABLE)
++  aui_enable_tests(aui.network)
++endif()
+\ No newline at end of file

+ 33 - 0
packages/a/aui/patches/v7.1.2/debundle-main.diff

@@ -0,0 +1,33 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6902d56..a6d4b2d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -64,9 +64,14 @@ function(define_aui_component AUI_COMPONENT_NAME)
+     add_subdirectory("aui.${AUI_COMPONENT_NAME}")
+ endfunction()
+ 
+-auib_import(ZLIB https://github.com/aui-framework/zlib
+-            VERSION 448a9c76a97202a21f68bd82e453dd743e944a3a
+-            CMAKE_ARGS -DZLIB_BUILD_EXAMPLES=OFF)
++if (AUIB_DISABLE)
++    find_package(ZLIB REQUIRED)
++    add_compile_definitions(GLM_ENABLE_EXPERIMENTAL=1)
++else ()
++    auib_import(ZLIB https://github.com/aui-framework/zlib
++                VERSION 448a9c76a97202a21f68bd82e453dd743e944a3a
++                CMAKE_ARGS -DZLIB_BUILD_EXAMPLES=OFF)
++endif ()
+ 
+ # define all components
+ define_aui_component(core)
+@@ -195,7 +200,9 @@ auib_precompiled_binary()
+ # [auib_precompiled_binary]
+ 
+ # test aui.boot on ci/cd
+-add_subdirectory(test/)
++if (NOT AUIB_DISABLE)
++    add_subdirectory(test/)
++endif ()
+ 
+ # [configure file example]
+ configure_file(cmake/aui-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/aui-config.cmake @ONLY)

+ 14 - 0
packages/a/aui/patches/v7.1.2/debundle-sqlite.diff

@@ -0,0 +1,14 @@
+diff --git a/aui.sqlite/CMakeLists.txt b/aui.sqlite/CMakeLists.txt
+index 6afd58f4..78a2a593 100644
+--- a/aui.sqlite/CMakeLists.txt
++++ b/aui.sqlite/CMakeLists.txt
+@@ -11,4 +11,6 @@ target_include_directories(aui.sqlite PRIVATE 3rdparty/sqlite3)
+ aui_link(aui.sqlite PUBLIC aui::core)
+ aui_link(aui.sqlite PUBLIC aui::data)
+ 
+-aui_enable_tests(aui.sqlite)
+\ No newline at end of file
++if (NOT AUIB_DISABLE)
++    aui_enable_tests(aui.sqlite)
++endif ()
+\ No newline at end of file

+ 14 - 0
packages/a/aui/patches/v7.1.2/debundle-toolbox.diff

@@ -0,0 +1,14 @@
+diff --git a/aui.toolbox/CMakeLists.txt b/aui.toolbox/CMakeLists.txt
+index c17cb1da..aa088ce4 100644
+--- a/aui.toolbox/CMakeLists.txt
++++ b/aui.toolbox/CMakeLists.txt
+@@ -7,4 +7,6 @@ endif()
+ 
+ aui_executable(aui.toolbox WIN32_SUBSYSTEM_CONSOLE EXPORT aui)
+ aui_link(aui.toolbox PRIVATE aui::core aui::crypt aui::image)
+-aui_enable_tests(aui.toolbox)
+\ No newline at end of file
++if (NOT AUIB_DISABLE)
++    aui_enable_tests(aui.toolbox)
++endif ()
+\ No newline at end of file

+ 21 - 0
packages/a/aui/patches/v7.1.2/debundle-uitests.diff

@@ -0,0 +1,21 @@
+diff --git a/aui.uitests/CMakeLists.txt b/aui.uitests/CMakeLists.txt
+index 5070f0a3..e4188094 100644
+--- a/aui.uitests/CMakeLists.txt
++++ b/aui.uitests/CMakeLists.txt
+@@ -8,9 +8,13 @@ aui_module(aui.uitests EXPORT aui)
+ 
+ aui_link(aui.uitests PRIVATE aui::core aui::views)
+ 
+-if (TARGET GTest::gmock)
+-  aui_link(aui.uitests PRIVATE GTest::gmock)
+-endif()
++if (AUIB_DISABLE)
++    aui_link(aui.uitests PRIVATE gmock::gmock)
++else ()
++  if (TARGET GTest::gmock)
++    aui_link(aui.uitests PRIVATE GTest::gmock)
++  endif()
++endif ()
+ 
+ aui_enable_tests(aui.uitests)
+ aui_enable_benchmarks(aui.uitests)

+ 115 - 0
packages/a/aui/patches/v7.1.2/debundle-views.diff

@@ -0,0 +1,115 @@
+diff --git a/aui.views/CMakeLists.txt b/aui.views/CMakeLists.txt
+index dfe6b18b..c5c1fb27 100644
+--- a/aui.views/CMakeLists.txt
++++ b/aui.views/CMakeLists.txt
+@@ -9,10 +9,14 @@ find_package(OpenGL)
+ auib_use_system_libs_end()
+ 
+ if (OPENGL_FOUND OR ANDROID OR IOS)
+-    auib_import(Freetype https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-3.zip ARCHIVE
+-                CONFIG_ONLY
+-                CMAKE_ARGS -DFT_DISABLE_BZIP2=ON -DFT_DISABLE_PNG=ON -DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_BROTLI=ON
+-    )
++    if (AUIB_DISABLE)
++        find_package(freetype CONFIG REQUIRED)
++    else ()
++        auib_import(Freetype https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-3.zip ARCHIVE
++                    CONFIG_ONLY
++                    CMAKE_ARGS -DFT_DISABLE_BZIP2=ON -DFT_DISABLE_PNG=ON -DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_BROTLI=ON
++        )
++    endif ()
+ 
+     if (NOT TARGET Freetype::Freetype)
+         message(FATAL_ERROR "Freetype not imported")
+@@ -20,29 +24,40 @@ if (OPENGL_FOUND OR ANDROID OR IOS)
+ 
+ 
+     if (AUI_PLATFORM_WIN OR AUI_PLATFORM_LINUX OR AUI_PLATFORM_MACOS)
+-        auib_import(GLEW https://github.com/aui-framework/glew-cmake
+-                CMAKE_WORKING_DIR "build/cmake"
+-                VERSION a80a1dc)
++        if (AUIB_DISABLE)
++            find_package(glew CONFIG REQUIRED)
++        else ()
++            auib_import(GLEW https://github.com/aui-framework/glew-cmake
++                    CMAKE_WORKING_DIR "build/cmake"
++                    VERSION a80a1dc)
++        endif ()
+     endif ()
+ 
+     aui_module(aui.views EXPORT aui)
+     aui_enable_tests(aui.views)
+ 
+     if (AUI_PLATFORM_LINUX)
+-        auib_use_system_libs_begin()
+-        find_package(PkgConfig REQUIRED)
++        if (AUIB_DISABLE)
++            include(FindPkgConfig)
++            pkg_check_modules(DBUS REQUIRED IMPORTED_TARGET dbus-1)
++            pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
++            aui_link(aui.views PRIVATE X11::X11 X11::Xrandr X11::Xcursor X11::Xi PkgConfig::DBUS PkgConfig::GTK3 Fontconfig::Fontconfig)
++        else ()
++            auib_use_system_libs_begin()
++            find_package(PkgConfig REQUIRED)
+ 
+-        pkg_check_modules(DBUS REQUIRED dbus-1)
+-        include_directories(${DBUS_INCLUDE_DIRS})
+-        link_directories(${DBUS_LIBRARY_DIRS})
++            pkg_check_modules(DBUS REQUIRED dbus-1)
++            include_directories(${DBUS_INCLUDE_DIRS})
++            link_directories(${DBUS_LIBRARY_DIRS})
+ 
+-        pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
+-        include_directories(${GTK3_INCLUDE_DIRS})
+-        link_directories(${GTK3_LIBRARY_DIRS})
++            pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
++            include_directories(${GTK3_INCLUDE_DIRS})
++            link_directories(${GTK3_LIBRARY_DIRS})
+ 
+-        auib_use_system_libs_end()
++            auib_use_system_libs_end()
+ 
+-        aui_link(aui.views PRIVATE X11::X11 X11::Xrandr X11::Xcursor X11::Xi ${DBUS_LIBRARIES} ${GTK3_LIBRARIES} Fontconfig::Fontconfig)
++            aui_link(aui.views PRIVATE X11::X11 X11::Xrandr X11::Xcursor X11::Xi ${DBUS_LIBRARIES} ${GTK3_LIBRARIES} Fontconfig::Fontconfig)
++        endif ()
+     endif ()
+ 
+     if (NOT AUI_PLATFORM_WINDOWS)
+@@ -92,17 +107,29 @@ if (OPENGL_FOUND OR ANDROID OR IOS)
+         aui_link(aui.views PRIVATE Freetype::Freetype)
+         aui_link(aui.views PRIVATE OpenGL::GL)
+ 
+-        if (AUI_PLATFORM_LINUX)
+-            # glew defines unwanted dependencies to OpenGL which may vary from distro to distro; silence them
+-            set_target_properties(GLEW::GLEW PROPERTIES INTERFACE_LINK_LIBRARIES "")
++        if (AUIB_DISABLE)
++            if (AUI_PLATFORM_LINUX)
++                # glew defines unwanted dependencies to OpenGL which may vary from distro to distro; silence them
++                set_target_properties(glew::glew PROPERTIES INTERFACE_LINK_LIBRARIES "")
++                auib_use_system_libs_begin()
++                find_package(X11 REQUIRED)
++                find_package(Fontconfig REQUIRED)
++                auib_use_system_libs_end()
++            endif ()
++            aui_link(aui.views PUBLIC glew::glew)
++        else ()
++            if (AUI_PLATFORM_LINUX)
++                # glew defines unwanted dependencies to OpenGL which may vary from distro to distro; silence them
++                set_target_properties(GLEW::GLEW PROPERTIES INTERFACE_LINK_LIBRARIES "")
+ 
+-            auib_use_system_libs_begin()
+-            find_package(X11 REQUIRED)
+-            find_package(Fontconfig REQUIRED)
+-            auib_use_system_libs_end()
++                auib_use_system_libs_begin()
++                find_package(X11 REQUIRED)
++                find_package(Fontconfig REQUIRED)
++                auib_use_system_libs_end()
+ 
++            endif ()
++            aui_link(aui.views PUBLIC GLEW::GLEW)
+         endif ()
+-        aui_link(aui.views PUBLIC GLEW::GLEW)
+ 
+         if (WIN32)
+             aui_link(aui.views PRIVATE dwmapi)

+ 21 - 0
packages/a/aui/patches/v7.1.2/fix-backport-lunasvg.diff

@@ -0,0 +1,21 @@
+diff --git a/aui.image/src/AUI/Image/svg/SvgImageFactory.cpp b/aui.image/src/AUI/Image/svg/SvgImageFactory.cpp
+index 7b638202..c4449d5b 100644
+--- a/aui.image/src/AUI/Image/svg/SvgImageFactory.cpp
++++ b/aui.image/src/AUI/Image/svg/SvgImageFactory.cpp
+@@ -15,7 +15,15 @@
+ 
+ #include "SvgImageFactory.h"
+ #include "AUI/Common/AByteBuffer.h"
+-#include <lunasvg/lunasvg.h>
++#if defined(__has_include)
++    #if __has_include(<lunasvg/lunasvg.h>)
++        #include <lunasvg/lunasvg.h>
++    #else
++        #include <lunasvg.h>
++    #endif
++#else
++    #include <lunasvg.h>
++#endif
+ 
+ 
+ SvgImageFactory::SvgImageFactory(AByteBufferView buf) {

+ 50 - 0
packages/a/aui/patches/v7.1.2/fix-msvc-pretty-function.diff

@@ -0,0 +1,50 @@
+diff --git a/aui.core/src/AUI/Reflect/AClass.h b/aui.core/src/AUI/Reflect/AClass.h
+index 7cbf3cfc..acccb19e 100644
+--- a/aui.core/src/AUI/Reflect/AClass.h
++++ b/aui.core/src/AUI/Reflect/AClass.h
+@@ -36,7 +36,13 @@ public:
+             name = name.substr(0, name.length() - 2);
+         return name;
+ #elif AUI_COMPILER_CLANG
++    #if defined(__PRETTY_FUNCTION__) || defined(__GNUC__) || defined(__clang__)
+         AString s = __PRETTY_FUNCTION__;
++    #elif defined(__FUNCSIG__)
++        AString s = __FUNCSIG__;
++    #else
++		AString s = __FUNCTION__;
++    #endif
+         auto b = s.find("=") + 1;
+         auto e = s.find("&", b);
+         e = std::min(s.find("]", b), e);
+@@ -44,7 +50,13 @@ public:
+         result = result.trim();
+         return result;
+ #else
++    #if defined(__PRETTY_FUNCTION__) || defined(__GNUC__) || defined(__clang__)
+         AString s = __PRETTY_FUNCTION__;
++    #elif defined(__FUNCSIG__)
++        AString s = __FUNCSIG__;
++    #else
++		AString s = __FUNCTION__;
++    #endif
+         auto b = s.find("with T = ") + 9;
+         return { s.begin() + b, s.end() - 1 };
+ #endif
+diff --git a/aui.core/src/AUI/Reflect/AEnumerate.h b/aui.core/src/AUI/Reflect/AEnumerate.h
+index 99d9d281..9419a4b3 100644
+--- a/aui.core/src/AUI/Reflect/AEnumerate.h
++++ b/aui.core/src/AUI/Reflect/AEnumerate.h
+@@ -39,7 +39,13 @@ namespace aui::enumerate::basic {
+ 
+         AString result(begin, end);
+ #else
++    #if defined(__PRETTY_FUNCTION__) || defined(__GNUC__) || defined(__clang__)
+             AString s = __PRETTY_FUNCTION__;
++    #elif defined(__FUNCSIG__)
++            AString s = __FUNCSIG__;
++    #else
++			AString s = __FUNCTION__;
++    #endif
+ #if AUI_COMPILER_CLANG
+             auto end = s.rfind(']');
+ #else

+ 21 - 0
packages/a/aui/patches/v7.1.2/fix-osx-enforce-cpp-template.diff

@@ -0,0 +1,21 @@
+diff --git a/aui.views/src/AUI/GL/gl.h b/aui.views/src/AUI/GL/gl.h
+index 64209c6..062af7b 100644
+--- a/aui.views/src/AUI/GL/gl.h
++++ b/aui.views/src/AUI/GL/gl.h
+@@ -10,7 +10,9 @@
+  */
+ 
+ #pragma once
++#if !AUI_PLATFORM_MACOS
+ extern "C" {
++#endif
+ #if AUI_PLATFORM_ANDROID
+ #include <GLES3/gl3.h>
+ #include <GLES3/gl31.h>
+@@ -27,4 +29,6 @@ extern "C" {
+ #include <GL/glew.h>
+ #include <GL/gl.h>
+ #endif
++#if !AUI_PLATFORM_MACOS
+ }
++#endif

+ 192 - 0
packages/a/aui/xmake.lua

@@ -0,0 +1,192 @@
+package("aui")
+    set_homepage("https://github.com/aui-framework/aui")
+    set_description("Declarative UI toolkit for modern C++20")
+    set_license("MPL-2.0")
+
+    add_urls("https://github.com/aui-framework/aui/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/aui-framework/aui.git")
+
+    add_versions("v7.1.2", "a4cf965c50d75e20a319c9c8b231ad9c13c25a06ad303e1eb65d1ff141b1f85c")
+
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-audio.diff", "464d798caaf366f3fadb689504584ad38b15af05c4f044c74c8290a151b082d9")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-build.diff", "92bfd68e28a703518c12cf51b898a6b75cacae1fec9384328562c47b003e9577")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-core.diff", "0b3cf2140767e2f5232a3769301f1ca8af8c5e07ded55a8f8a98e627a597fd64")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-crypt.diff", "58045d168a8c7f2658554e0a3010579ec53b54e2c51f524a4fb61e5e4d6fc0a7")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-curl.diff", "937280a828ce0bc30a590606e7d65de55c9421d0650897c2d775e3731405a4b0")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-image.diff", "44bb7e78eab9629c92ef953ec1e0aca9e80712fe2488d6ffa804924d418ebf05")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-json-network.diff", "6d7d8da64cf85212e14757f7d24ac5ac6501dfd0ff3a4fcbe973c7c58c4f213c")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-main.diff", "c1cac9dfbae14baaddb68837055a7a858c08786750a16cbbfe955a1f18e5878d")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-sqlite.diff", "1728a4b9afc473acc81b16c544239e6f70a147c0623d894d59dd124e27c94311")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-toolbox.diff", "1ec1abf993eb7e583d32602e1ae8ee4d3358d156e9fac185c0d19ed85660bd3b")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-uitests.diff", "831a208eff22c5536ada4ea4a4e2496868977c2ee9b7d7e534bc6bdeae537d86")
+    add_patches("v7.1.2", "patches/v7.1.2/debundle-views.diff", "b691b46fc425f7c497de18b77b4ad2ac62cf61c983688f2402a50d727770e28f")
+    add_patches("v7.1.2", "patches/v7.1.2/fix-backport-lunasvg.diff", "daf24391b88e44bdb801b2c1ba36a695f95384d8157ccb23cfc635d5f30bea4a")
+    add_patches("v7.1.2", "patches/v7.1.2/fix-msvc-pretty-function.diff", "268f66f42594f0188fe50d33f5783e66f66024087097ebfdfef60c9768e151fd")
+    add_patches("v7.1.2", "patches/v7.1.2/fix-osx-enforce-cpp-template.diff", "eef4147a8b037552887777cd497c190ecc22514bb11fb3a3d6ea433a78cce61b")
+
+    add_deps("cmake")
+    if is_subhost("windows") then
+        add_deps("pkgconf")
+    else
+        add_deps("pkg-config")
+    end
+    add_deps("zlib")
+
+    -- aui.audio
+    on_component("audio", function (package, component)
+        package:add("includedirs", "aui.audio/include")
+        component:add("links", "aui.audio")
+        package:add("deps", "libopus", "soxr")
+        if package:is_plat("linux") then
+            component:add("syslinks", "pulse")
+        elseif package:is_plat("android") then
+            package:add("deps", "oboe")
+        elseif package:is_plat("windows", "mingw") then
+            component:add("syslinks", "winmm", "dsound", "dxguid")
+        elseif package:is_plat("macosx", "iphoneos") then
+            component:add("frameworks", "CoreAudio", "AVFoundation", "AudioToolbox")
+            if package:is_plat("macosx") then
+                component:add("frameworks", "AppKit", "Cocoa", "CoreData", "Foundation", "QuartzCore")
+            end
+        end
+    end)
+
+    -- aui.core
+    on_component("core", function (package, component)
+        package:add("includedirs", "aui.core/include")
+        component:add("links", "aui.core")
+        package:add("deps", "fmt 9.1.0", "range-v3", "glm")
+        if package:is_plat("linux") then
+            package:add("deps", "libbacktrace")
+            component:add("syslinks", "threads", "dl")
+        elseif package:is_plat("windows", "mingw") then
+            component:add("syslinks", "dbghelp", "shell32", "shlwapi", "kernel32", "psapi")
+        elseif package:is_plat("android") then
+            component:add("syslinks", "log")
+        end
+    end)
+
+    -- aui.crypt
+    on_component("crypt", function (package, component)
+        package:add("includedirs", "aui.crypt/include")
+        component:add("links", "aui.crypt")
+        package:add("deps", "openssl3")
+        if package:is_plat("windows", "mingw") then
+            component:add("syslinks", "wsock32", "ws2_32")
+        end
+    end)
+
+    -- aui.curl
+    on_component("curl", function (package, component)
+        package:add("includedirs", "aui.curl/include")
+        component:add("links", "aui.curl")
+        package:add("deps", "libcurl")
+    end)
+
+    -- aui.image
+    on_component("image", function (package, component)
+        package:add("includedirs", "aui.image/include")
+        component:add("links", "aui.image")
+        package:add("deps", "lunasvg", "libwebp")
+    end)
+
+    -- aui.json
+    on_component("json", function (package, component)
+        package:add("includedirs", "aui.json/include")
+        component:add("links", "aui.json")
+    end)
+
+    -- aui.network
+    on_component("network", function (package, component)
+        package:add("includedirs", "aui.network/include")
+        component:add("links", "aui.network")
+        if package:is_plat("windows", "mingw") then
+            component:add("syslinks", "wsock32", "ws2_32", "iphlpapi")
+        end
+    end)
+
+    -- aui.toolbox
+    on_component("toolbox", function (package, component)
+        package:add("includedirs", "aui.toolbox/include")
+    end)
+
+    -- aui.uitests
+    on_component("uitests", function (package, component)
+        package:add("includedirs", "aui.uitests/include")
+        component:add("links", "aui.uitests")
+        package:add("deps", "gtest", "benchmark")
+    end)
+
+    -- aui.views
+    on_component("views", function (package, component)
+        package:add("includedirs", "aui.views/include")
+        component:add("links", "aui.views")
+        package:add("deps", "freetype")
+        if package:is_plat("windows", "mingw", "linux", "macosx") then
+            package:add("deps", "glew")
+        end
+        if package:is_plat("linux") then
+            package:add("deps", "libx11", "dbus", "gtk3", "fontconfig")
+        end
+        if package:is_plat("windows", "mingw") then
+            component:add("syslinks", "dwmapi", "winmm", "shlwapi")
+        elseif package:is_plat("android") then
+            component:add("syslinks", "EGL", "GLESv2", "GLESv3")
+        elseif package:is_plat("iphoneos") then
+            component:add("frameworks", "OpenGLES")
+        elseif package:is_plat("macosx") then
+            component:add("frameworks", "AppKit", "Cocoa", "CoreData", "Foundation", "QuartzCore", "UniformTypeIdentifiers")
+        end
+    end)
+
+    -- aui.xml
+    on_component("xml", function (package, component)
+        package:add("includedirs", "aui.xml/include")
+        component:add("links", "aui.xml")
+    end)
+
+    on_load(function (package)
+        package:add("components", "audio", "core", "crypt", "curl", "image", "json", "network", "toolbox", "uitests", "views", "xml")
+        if not package:config("shared") then
+            package:add("defines", "AUI_STATIC")
+        end
+        package:add("defines", "AUI_DEBUG=" .. (package:is_debug() and "1" or "0"))
+        package:add("defines", "API_AUI_CORE=AUI_IMPORT")
+        package:add("defines", "GLM_ENABLE_EXPERIMENTAL=1")
+    end)
+
+    on_install("windows|!arm*", "macosx", function (package)
+        local configs = {
+            "-DAUI_INSTALL_RUNTIME_DEPENDENCIES=OFF",
+            "-DAUIB_NO_PRECOMPILED=TRUE",
+            "-DAUIB_DISABLE=ON"
+        }
+        local opt = {}
+        if package:is_plat("macosx") then
+            if package:config("shared") then
+                opt.packagedeps = {"gtest"}
+            end
+        elseif package:is_plat("windows") then
+            if package:config("shared") then
+                opt.packagedeps = {"glew", "gtest"}
+            end
+            if package:has_tool("cxx", "cl", "clang_cl") then
+                opt.cxflags = {"/EHsc"}
+            end
+        end
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
+        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        import("package.tools.cmake").install(package, configs, opt)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <AUI/Platform/Entry.h>
+            #include <AUI/Logging/ALogger.h>
+            #include <AUI/Common/AByteBuffer.h>
+            #include <AUI/Url/AUrl.h>
+            void test() {
+                auto buf = AByteBuffer::fromStream(AUrl(":test.txt").open());
+            }
+        ]]}, {configs = {languages = "c++20"}}))
+    end)

+ 1 - 0
packages/g/glew/port/xmake.lua

@@ -5,6 +5,7 @@ if is_plat("linux") then
 end
 
 target("glew")
+    add_rules("utils.install.cmake_importfiles")
     set_kind("$(kind)")
     if is_plat("windows", "mingw") then
         set_basename(is_kind("shared") and "glew32" or "glew32s")

+ 2 - 1
packages/g/gtest/xmake.lua

@@ -26,7 +26,7 @@ package("gtest")
     add_configs("main",  {description = "Link to the gtest_main entry point.", default = false, type = "boolean"})
     add_configs("gmock", {description = "Link to the googlemock library.", default = true, type = "boolean"})
 
-    if is_plat("linux") then
+    if is_plat("linux", "bsd") then
         add_syslinks("pthread")
     end
 
@@ -42,6 +42,7 @@ package("gtest")
             std = "cxx17"
         end
         io.writefile("xmake.lua", format([[
+            add_rules("utils.install.cmake_importfiles")
             set_languages("%s")
             target("gtest")
                 set_kind("$(kind)")