aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/xmake.lua
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-05-02 10:01:47 +0200
committerGitHub <[email protected]>2023-05-02 10:01:47 +0200
commit075d17f8ada47e990fe94606c3d21df409223465 (patch)
treee50549b766a2f3c354798a54ff73404217b4c9af /src/zencore/xmake.lua
parentfix: bundle shouldn't append content zip to zen (diff)
downloadzen-075d17f8ada47e990fe94606c3d21df409223465.tar.xz
zen-075d17f8ada47e990fe94606c3d21df409223465.zip
moved source directories into `/src` (#264)
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees
Diffstat (limited to 'src/zencore/xmake.lua')
-rw-r--r--src/zencore/xmake.lua61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/zencore/xmake.lua b/src/zencore/xmake.lua
new file mode 100644
index 000000000..e1e649c1d
--- /dev/null
+++ b/src/zencore/xmake.lua
@@ -0,0 +1,61 @@
+-- Copyright Epic Games, Inc. All Rights Reserved.
+
+target('zencore')
+ set_kind("static")
+ add_headerfiles("**.h")
+ add_configfiles("include/zencore/config.h.in")
+ on_load(function (target)
+ local version = io.readfile("VERSION.txt")
+ version = string.gsub(version,"%-pre.*", "")
+ target:set("version", version:trim(), {build = "%Y%m%d%H%M"})
+ end)
+ set_configdir("include/zencore")
+ add_files("**.cpp")
+ add_includedirs("include", {public=true})
+ add_includedirs("$(projectdir)/thirdparty/utfcpp/source")
+ add_includedirs("$(projectdir)/thirdparty/trace", {public=true})
+ if is_os("windows") then
+ add_linkdirs("$(projectdir)/thirdparty/Oodle/lib/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_options("zentrace")
+ add_packages(
+ "vcpkg::blake3",
+ "vcpkg::cpr",
+ "vcpkg::curl", -- required by cpr
+ "vcpkg::doctest",
+ "vcpkg::fmt",
+ "vcpkg::gsl-lite",
+ "vcpkg::json11",
+ "vcpkg::lz4",
+ "vcpkg::mimalloc",
+ "vcpkg::openssl", -- required by curl
+ "vcpkg::spdlog",
+ "vcpkg::zlib", -- required by curl
+ "vcpkg::xxhash")
+
+ if is_plat("linux") then
+ -- The 'vcpkg::openssl' package is two libraries; ssl and crypto, with
+ -- ssl being dependent on symbols in crypto. When GCC-like linkers read
+ -- object files from their command line, those object files only resolve
+ -- symbols of objects previously encountered. Thus crypto must appear
+ -- after ssl so it can fill out ssl's unresolved symbol table. Xmake's
+ -- vcpkg support is basic and works by parsing .list files. Openssl's
+ -- archives are listed alphabetically causing crypto to be _before_ ssl
+ -- and resulting in link errors. The links are restated here to force
+ -- xmake to use the correct order, and "syslinks" is used to force the
+ -- arguments to the end of the line (otherwise they can appear before
+ -- curl and cause more errors).
+ add_syslinks("crypto")
+ add_syslinks("dl")
+ end
+
+ if is_plat("linux") then
+ add_syslinks("rt")
+ end