aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/xmake.lua
blob: 5f2d95e165e024d27d7820ee6726f7d38b711b52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-- Copyright Epic Games, Inc. All Rights Reserved.

target('zencore')
    set_kind("static")
    set_group("libs")
    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/Oodle/include")
    add_includedirs("$(projectdir)/thirdparty/trace", {public=true})
    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_options("zentrace")
    add_deps("zenbase")
    add_packages(
        "vcpkg::blake3", 
        "vcpkg::json11",
        "vcpkg::ryml",
        "vcpkg::c4core",
        "vcpkg::mimalloc",
        "vcpkg::openssl", -- required for crypto
        "vcpkg::spdlog")

    add_packages(
        "vcpkg::doctest", 
        "vcpkg::fmt",
        "vcpkg::gsl-lite", 
        "vcpkg::lz4",
        "vcpkg::xxhash",
        {public=true}
    )

    if is_plat("linux") then
        add_syslinks("rt")
    end

    if is_plat("windows") then
        add_syslinks("Advapi32")
        add_syslinks("Dbghelp")
        add_syslinks("Shell32")
        add_syslinks("User32")
        add_syslinks("crypt32")
        add_syslinks("bcrypt")
        add_syslinks("ws2_32")
    end