forked from powerof3/CommonLibSSE
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxmake.lua
More file actions
69 lines (53 loc) · 1.96 KB
/
xmake.lua
File metadata and controls
69 lines (53 loc) · 1.96 KB
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
68
69
-- set minimum xmake version
set_xmakever("3.0.0")
-- set project constants
set_project("commonlibsse")
set_arch("x64")
set_languages("c++23")
set_warnings("allextra")
set_encodings("utf-8")
-- add common rules
add_rules("mode.debug", "mode.releasedbg")
add_rules("plugin.vsxmake.autoupdate")
-- include subprojects
includes("lib/commonlib-shared")
-- define targets
target("commonlibsse", function()
-- set target kind
set_kind("static")
-- set build by default
set_default(os.scriptdir() == os.projectdir())
-- add dependencies
add_deps("commonlib-shared", { public = true })
-- add source files
add_files("src/**.cpp")
-- add header files
add_includedirs("include", { public = true })
add_headerfiles(
"include/(RE/**.h)",
"include/(SKSE/**.h)"
)
-- add extra files
add_extrafiles("res/commonlibsse.natvis")
-- set precompiled header
set_pcxxheader("include/SKSE/Impl/PCH.h")
end)
rule("commonlibsse.plugin", function()
add_deps("commonlib.plugin")
on_load(function(target)
target:data_set("commonlib.plugin.config", target:extraconf("rules", "commonlibsse.plugin"))
target:data_set("commonlib.plugin.package", { prefixdir = "Data" })
end)
on_config(function(target)
target:add("deps", "commonlibsse")
target:add("configfiles", path.join(os.scriptdir(), "res/commonlibsse-plugin.cpp.in"))
target:add("files", path.join(target:configdir(), "commonlibsse-plugin.cpp"))
if os.getenv("XSE_TES5_MODS_PATH") then
target:set("installdir", path.join(os.getenv("XSE_TES5_MODS_PATH"), target:name()))
elseif os.getenv("XSE_TES5_GAME_PATH") then
target:set("installdir", path.join(os.getenv("XSE_TES5_GAME_PATH"), "Data"))
end
target:add("installfiles", target:targetfile(), { prefixdir = "SKSE/Plugins" })
target:add("installfiles", target:symbolfile(), { prefixdir = "SKSE/Plugins" })
end)
end)