aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2025-10-15 22:03:56 +0200
committerGitHub Enterprise <[email protected]>2025-10-15 22:03:56 +0200
commit5c3ead7d717512aaae237d9009c312e3f61d154d (patch)
tree3ff3716d77d5102a354b08eba8ec729019fc0626
parentmove file i/o related files to separate file and remove duplicated code (#576) (diff)
downloadzen-5c3ead7d717512aaae237d9009c312e3f61d154d.tar.xz
zen-5c3ead7d717512aaae237d9009c312e3f61d154d.zip
added separate xmake.lua for thirdparty (#578)
Moves out third-party stuff from zencore Establishes new pattern for incorporating thirdparty code. The integration is cleaner, clearer and also surfaces the code in the generated .sln
-rw-r--r--src/zencore/xmake.lua30
-rw-r--r--thirdparty/xmake.lua45
-rw-r--r--xmake.lua1
3 files changed, 53 insertions, 23 deletions
diff --git a/src/zencore/xmake.lua b/src/zencore/xmake.lua
index b3a33e052..fcb2afaf7 100644
--- a/src/zencore/xmake.lua
+++ b/src/zencore/xmake.lua
@@ -5,6 +5,7 @@ target('zencore')
set_group("libs")
add_options("zentrace", "zenmimalloc", "zenrpmalloc")
add_headerfiles("**.h")
+ add_includedirs("include", {public=true})
add_configfiles("include/zencore/config.h.in")
on_load(function (target)
local version = io.readfile("VERSION.txt")
@@ -16,36 +17,19 @@ target('zencore')
add_files("trace.cpp", {unity_ignored = true })
if has_config("zenrpmalloc") then
- set_languages("c17", "cxx20")
- if is_os("windows") then
- add_cflags("/experimental:c11atomics")
- end
- add_defines("RPMALLOC_FIRST_CLASS_HEAPS=1", "ENABLE_STATISTICS=1", "ENABLE_OVERRIDE=0")
- add_files("$(projectdir)/thirdparty/rpmalloc/rpmalloc.c")
+ add_deps("rpmalloc")
end
if has_config("zenmimalloc") then
add_packages("vcpkg::mimalloc")
end
- add_includedirs("include", {public=true})
- add_includedirs("$(projectdir)/thirdparty/GetTimeSinceProcessStart")
- add_includedirs("$(projectdir)/thirdparty/utfcpp/source")
- add_includedirs("$(projectdir)/thirdparty/Oodle/include")
- add_includedirs("$(projectdir)/thirdparty/trace", {public=true})
- add_includedirs("$(projectdir)/thirdparty/rpmalloc")
- if is_os("windows") then
- add_linkdirs("$(projectdir)/thirdparty/Oodle/lib/Win64")
- add_links("oo2core_win64")
- elseif is_os("linux") then
- add_linkdirs("$(projectdir)/thirdparty/Oodle/lib/Linux_x64")
- add_links("oo2corelinux64")
- add_syslinks("pthread")
- elseif is_os("macosx") then
- add_linkdirs("$(projectdir)/thirdparty/Oodle/lib/Mac_x64")
- add_links("oo2coremac64")
- end
add_deps("zenbase")
+ add_deps("utfcpp")
+ add_deps("oodle")
+ add_deps("ue-trace")
+ add_deps("timesinceprocessstart")
+
add_packages(
"vcpkg::blake3",
"vcpkg::json11",
diff --git a/thirdparty/xmake.lua b/thirdparty/xmake.lua
new file mode 100644
index 000000000..d745a5109
--- /dev/null
+++ b/thirdparty/xmake.lua
@@ -0,0 +1,45 @@
+target('utfcpp')
+ set_kind("headeronly")
+ set_group("thirdparty")
+ add_headerfiles("utfcpp/**.h")
+ add_includedirs("utfcpp/source", {public=true})
+
+target('oodle')
+ set_kind('headeronly')
+ set_group("thirdparty")
+ add_includedirs("Oodle/include", {public=true})
+ if is_os("windows") then
+ add_linkdirs("Oodle/lib/Win64", {public=true})
+ add_links("oo2core_win64", {public=true})
+ elseif is_os("linux") then
+ add_linkdirs("Oodle/lib/Linux_x64", {public=true})
+ add_links("oo2corelinux64", {public=true})
+ add_syslinks("pthread", {public=true})
+ elseif is_os("macosx") then
+ add_linkdirs("Oodle/lib/Mac_x64", {public=true})
+ add_links("oo2coremac64", {public=true})
+ end
+
+target('timesinceprocessstart')
+ set_kind('headeronly')
+ set_group('thirdparty')
+ add_includedirs("GetTimeSinceProcessStart", {public=true})
+ add_headerfiles("GetTimeSinceProcessStart/**.h")
+
+target('ue-trace')
+ set_kind('headeronly')
+ set_group('thirdparty')
+ add_includedirs("trace", {public=true})
+ add_headerfiles("trace/**.h")
+
+target('rpmalloc')
+ set_kind("static")
+ set_group('thirdparty')
+ set_languages("c17", "cxx20")
+ if is_os("windows") then
+ add_cflags("/experimental:c11atomics")
+ end
+ add_defines("RPMALLOC_FIRST_CLASS_HEAPS=1", "ENABLE_STATISTICS=1", "ENABLE_OVERRIDE=0")
+ add_files("rpmalloc/rpmalloc.c")
+ add_headerfiles("rpmalloc/**.h")
+ add_includedirs("rpmalloc", {public=true})
diff --git a/xmake.lua b/xmake.lua
index 7242c61ab..5fccd3300 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -193,6 +193,7 @@ set_languages("cxx20")
-- always generate debug information
set_symbols("debug")
+includes("thirdparty")
includes("src/transports")
includes("src/zenbase")
includes("src/zencore", "src/zencore-test")