aboutsummaryrefslogtreecommitdiff
path: root/xmake.lua
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-12-14 12:34:47 +0100
committerPer Larsson <[email protected]>2021-12-14 12:34:47 +0100
commitb6c6568e1618f10d2160d836b65e35586e3c740f (patch)
treef6a929cf918850bbba87d0ee67cd3482b2d50e24 /xmake.lua
parentFixed bug in z$ service returning partial cache records and enable small obje... (diff)
parentPartial revert b363c5b (diff)
downloadzen-b6c6568e1618f10d2160d836b65e35586e3c740f.tar.xz
zen-b6c6568e1618f10d2160d836b65e35586e3c740f.zip
Merged main.
Diffstat (limited to 'xmake.lua')
-rw-r--r--xmake.lua120
1 files changed, 91 insertions, 29 deletions
diff --git a/xmake.lua b/xmake.lua
index 1da00b8df..c1aef5f85 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -1,24 +1,25 @@
add_requires(
- "vcpkg::doctest",
- "vcpkg::spdlog",
- "vcpkg::gsl-lite",
- "vcpkg::asio",
- "vcpkg::cpr",
- "vcpkg::xxhash",
- "vcpkg::robin-map",
- "vcpkg::lz4",
- "vcpkg::fmt",
- "vcpkg::cxxopts",
- "vcpkg::mimalloc",
- "vcpkg::sol2",
- "vcpkg::sentry-native",
- "vcpkg::json11",
- "vcpkg::lua",
- "vcpkg::curl",
- "vcpkg::zlib",
- "vcpkg::zstd",
+ "vcpkg::asio",
+ "vcpkg::cpr",
+ "vcpkg::curl",
+ "vcpkg::cxxopts",
+ "vcpkg::doctest",
+ "vcpkg::fmt",
+ "vcpkg::gsl-lite",
"vcpkg::http-parser",
- "vcpkg::rocksdb")
+ "vcpkg::json11",
+ "vcpkg::lua",
+ "vcpkg::lz4",
+ "vcpkg::mimalloc",
+ "vcpkg::openssl",
+ "vcpkg::robin-map",
+ "vcpkg::sentry-native",
+ "vcpkg::sol2",
+ "vcpkg::spdlog",
+ "vcpkg::xxhash",
+ "vcpkg::zlib",
+ "vcpkg::zstd"
+)
add_rules("mode.debug", "mode.release")
@@ -40,27 +41,88 @@ else
end
if is_os("windows") then
- add_defines("_CRT_SECURE_NO_WARNINGS", "_UNICODE", "UNICODE", "_WIN32_WINNT=0x0A00")
+ add_defines(
+ "_CRT_SECURE_NO_WARNINGS",
+ "_UNICODE",
+ "UNICODE",
+ "_CONSOLE",
+ "NOMINMAX", -- stop Windows SDK defining 'min' and 'max'
+ "NOGDI", -- otherwise Windows.h defines 'GetObject'
+ "WIN32_LEAN_AND_MEAN", -- cut down Windows.h
+ "_WIN32_WINNT=0x0A00"
+ )
-- add_ldflags("/MAP")
end
-add_defines("USE_SENTRY=1")
-add_defines("ZEN_USE_MIMALLOC=1")
+if is_os("linux") then
+ add_cxxflags("-Wno-unused-value")
+ add_cxxflags("-Wno-strict-aliasing")
+ add_cxxflags("-Wno-implicit-fallthrough")
+ add_cxxflags("-Wno-missing-field-initializers")
+end
-option("vfs")
+-- Turn use of undefined cpp macros into errors
+if is_os("windows") then
+ add_cxxflags("/we4668")
+else
+ add_cxxflags("-Wundef")
+end
+
+function add_define_by_config(define, config_name)
+ local value = has_config(config_name) and 1 or 0
+ add_defines(define.."="..value)
+end
+
+option("zensentry")
+ set_default(true)
set_showmenu(true)
- set_description("Enable VFS functionality")
- add_defines("ZEN_WITH_VFS")
+ set_description("Enables Sentry support in Zen")
option_end()
+add_define_by_config("USE_SENTRY", "zensentry")
-option("httpsys")
+option("zenmimalloc")
set_default(true)
set_showmenu(true)
- set_description("Enable http.sys server")
- add_defines("ZEN_WITH_HTTPSYS")
+ set_description("Use MiMalloc as Zen's allocator")
option_end()
+add_define_by_config("ZEN_USE_MIMALLOC", "zenmimalloc")
-add_defines("UNICODE", "_CONSOLE")
+if is_os("windows") then
+ option("vfs")
+ set_showmenu(true)
+ set_description("Enable VFS functionality")
+ option_end()
+ add_define_by_config("ZEN_WITH_VFS", "vfs")
+
+ option("httpsys")
+ set_default(true)
+ set_showmenu(true)
+ set_description("Enable http.sys server")
+ option_end()
+ add_define_by_config("ZEN_WITH_HTTPSYS", "httpsys")
+end
+
+option("compute")
+ set_default(is_os("windows"))
+ set_showmenu(true)
+ set_description("Enable compute services endpoint")
+option_end()
+add_define_by_config("ZEN_WITH_COMPUTE_SERVICES", "compute")
+
+option("zenmesh")
+ set_default(false)
+ set_showmenu(true)
+ set_description("Enables Zen's mesh feature")
+option_end()
+add_define_by_config("ZEN_ENABLE_MESH", "zenmesh")
+
+option("zentrace")
+ set_default(false)
+ set_showmenu(true)
+ set_description("Enable UE's Trace support")
+ add_includedirs("thirdparty/trace")
+option_end()
+add_define_by_config("ZEN_WITH_TRACE", "zentrace")
set_warnings("allextra", "error")
set_languages("cxx20")