-
Notifications
You must be signed in to change notification settings - Fork 192
/
xmake.lua
67 lines (53 loc) · 2.29 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
59
60
61
62
63
64
65
66
67
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")
if get_config("ue4ssCross") ~= "msvc-wine" then
includes("UVTD")
end
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"))
option("ue4ssCross")
set_default("None")
set_showmenu(true)
set_values("msvc-wine", "None")
set_description("Which cross-compiling toolchain to use", "msvc-wine", "None")