-
Notifications
You must be signed in to change notification settings - Fork 185
/
xmake.lua
58 lines (46 loc) · 2.05 KB
/
xmake.lua
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
set_xmakever("2.9.3")
-- We should use `get_config("ue4ssRoot")` instead of `os.projectdir()` or `$(projectdir)`.
-- This is because os.projectdir() will return a higher parent dir
-- when UE4SS is sub-moduled/`include("UE4SS")` in another xmake project.
set_config("ue4ssRoot", os.scriptdir())
-- All non-binary outputs are written to the Intermediates dir.
set_config("buildir", "Intermediates")
-- Any lua modules in this directory can be imported in the script scope by using
-- /modules/my_module.lua import("my_module")
-- /modules/rules/my_module.lua import("rules.my_module")
add_moduledirs("tools/xmakescripts/modules")
-- Add the plugins dir to support custom xmake <command>.
add_plugindirs("tools/xmakescripts/plugins")
-- Load our rule files into the global scope.
includes("tools/xmakescripts/rules/**.lua")
-- Generate the mode rules.
local modes = generate_compilation_modes()
-- Enter the existing ue4ss.base rule scope in order to add all xxx__xxx__xxx modes
-- to the ue4ss.base rule.
rule("ue4ss.base")
for _, mode in ipairs(modes) do
-- add_rules() expects the format `mode.Game__Shipping__Win64`
add_deps("mode."..mode)
end
rule_end()
-- Add the ue4ss.core rule to all targets within the UE4SS repository.
add_rules("ue4ss.core")
-- Restrict the compilation modes/configs.
-- These restrictions are inherited upstream and downstream.
-- Any project that `includes("UE4SS")` will inherit these global restrictions.
set_allowedplats("windows")
set_allowedarchs("x64")
set_allowedmodes(modes)
if is_host("windows") then
set_defaultmode("Game__Shipping__Win64")
end
-- Override the `xmake install` behavior for all targets.
-- Targets can re-override the on_install() function to implement custom installation behavior.
on_install(function(target) end)
includes("deps")
includes("UE4SS")
includes("UVTD")
includes("cppmods")
-- TODO: Remove this before the next release. It only exists to maintain backwards compat
-- warnings for older mod templates.
set_config("scriptsRoot", path.join(os.scriptdir(), "tools/xmakescripts"))