diff options
| author | Stefan Boberg <[email protected]> | 2025-11-07 14:49:13 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-11-07 14:49:13 +0100 |
| commit | 24e43a913f29ac3b314354e8ce5175f135bcc64f (patch) | |
| tree | ca442937ceeb63461012b33a4576e9835099f106 /thirdparty/xmake.lua | |
| parent | get oplog attachments (#622) (diff) | |
| download | zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.tar.xz zen-24e43a913f29ac3b314354e8ce5175f135bcc64f.zip | |
switch to xmake for package management (#611)
This change removes our dependency on vcpkg for package management, in favour of bringing some code in-tree in the `thirdparty` folder as well as using the xmake build-in package management feature. For the latter, all the package definitions are maintained in the zen repo itself, in the `repo` folder.
It should now also be easier to build the project as it will no longer depend on having the right version of vcpkg installed, which has been a common problem for new people coming in to the codebase. Now you should only need xmake to build.
* Bumps xmake requirement on github runners to 2.9.9 to resolve an issue where xmake on Windows invokes cmake with `v144` toolchain which does not exist
* BLAKE3 is now in-tree at `thirdparty/blake3`
* cpr is now in-tree at `thirdparty/cpr`
* cxxopts is now in-tree at `thirdparty/cxxopts`
* fmt is now in-tree at `thirdparty/fmt`
* robin-map is now in-tree at `thirdparty/robin-map`
* ryml is now in-tree at `thirdparty/ryml`
* sol2 is now in-tree at `thirdparty/sol2`
* spdlog is now in-tree at `thirdparty/spdlog`
* utfcpp is now in-tree at `thirdparty/utfcpp`
* xmake package repo definitions is in `repo`
* implemented support for sanitizers. ASAN is supported on windows, TSAN, UBSAN, MSAN etc are supported on Linux/MacOS though I have not yet tested it extensively on MacOS
* the zencore encryption implementation also now supports using mbedTLS which is used on MacOS, though for now we still use openssl on Linux
* crashpad
* bumps libcurl to 8.11.0 (from 8.8.0) which should address a rare build upload bug
Diffstat (limited to 'thirdparty/xmake.lua')
| -rw-r--r-- | thirdparty/xmake.lua | 86 |
1 files changed, 82 insertions, 4 deletions
diff --git a/thirdparty/xmake.lua b/thirdparty/xmake.lua index f1201c02e..6c5800f9d 100644 --- a/thirdparty/xmake.lua +++ b/thirdparty/xmake.lua @@ -68,10 +68,7 @@ target('cpr') else add_cxxflags("-Wno-undef") end - add_packages("vcpkg::curl", - "vcpkg::openssl", -- required by curl - "vcpkg::zlib" -- required by curl - ) + add_packages("libcurl", {public=true}) target('asio') set_kind('headeronly') @@ -79,3 +76,84 @@ target('asio') add_defines("ASIO_STANDLONE", "ASIO_HEADER_ONLY", {public=true}) add_headerfiles("asio/asio/include/**.hpp") add_includedirs("asio/asio/include", {public=true}) + +target("blake3") + set_kind("static") + set_group('thirdparty') + add_files("blake3/c/blake3.c", "blake3/c/blake3_dispatch.c", "blake3/c/blake3_portable.c") + add_headerfiles("blake3/c/blake3.h") + add_includedirs("blake3/c", {public=true}) + + if is_os("windows") then + add_cflags("/experimental:c11atomics") + add_cflags("/wd4245") -- conversion from 'type1' to 'type2', possible loss of data + elseif is_os("macosx") then + add_cflags("-Wno-unused-function") + end + + if is_arch("x86_64", "x64") then + if is_subhost("msys", "cygwin") then + add_files("blake3/c/*x86-64_windows_gnu.S") + elseif is_plat("windows") then + add_files("blake3/c/*x86-64_windows_msvc.asm") + else + add_files("blake3/c/*x86-64_unix.S") + end + elseif is_arch("x86", "i386") then + add_files("blake3/c/blake3_portable.c") + add_files("blake3/c/blake3_sse2.c") + add_files("blake3/c/blake3_sse41.c") + add_files("blake3/c/blake3_avx2.c") + add_files("blake3/c/blake3_avx512.c") + elseif is_arch("arm64", "arm64-v8a") then + add_files("blake3/c/blake3_neon.c") + add_defines("BLAKE3_USE_NEON=1") + end + +target("cxxopts") + set_kind("headeronly") + set_group("thirdparty") + add_headerfiles("cxxopts/include/**.hpp") + add_includedirs("cxxopts/include", {public=true}) + +target("doctest") + set_kind("headeronly") + set_group("thirdparty") + add_headerfiles("doctest/**.h") + add_includedirs("doctest", {public=true}) + +target("sol2") + set_kind("headeronly") + set_group("thirdparty") + add_defines("SOL_INSIDE_UNREAL=0", {public=true}) + add_headerfiles("sol2/**.hpp") + add_includedirs("sol2", {public=true}) + +target("robin-map") + set_kind("headeronly") + set_group("thirdparty") + add_headerfiles("robin-map/include/*.h") + add_includedirs("robin-map/include", {public=true}) + +target("fmt") + set_kind("static") + set_group("thirdparty") + add_files("fmt/src/format.cc", "fmt/src/os.cc") + add_headerfiles("fmt/include/**.h") + add_includedirs("fmt/include", {public=true}) + +target("ryml") + set_kind("static") + set_group("thirdparty") + add_files("ryml/src/**.cpp") + add_files("ryml/ext/c4core/src/c4/*.cpp") + add_headerfiles("ryml/ext/c4core/src/**.hpp") + add_headerfiles("ryml/src/**.hpp") + add_includedirs("ryml/src", {public=true}) + add_includedirs("ryml/ext/c4core/src", {public=true}) + + if is_os("windows") then + add_cxxflags("/wd4668") -- 'symbol' : undefined macro is treated as '0' in '#if/#elif' preprocessor directives + else + add_cxxflags("-Wno-unused-but-set-variable", "-Wno-undef") + end |