forked from qudix/commonlibsse-ng-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
68 lines (57 loc) · 1.96 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
68
-- set minimum xmake version
set_xmakever("2.9.1")
-- set project
set_project("template-commonlibsse-ng")
set_version("0.0.0")
set_license("MIT")
set_languages("c++23")
set_optimize("faster")
set_warnings("allextra", "error")
-- set allowed
set_allowedarchs("windows|x64")
set_allowedmodes("debug", "releasedbg")
-- set defaults
set_defaultarchs("windows|x64")
set_defaultmode("releasedbg")
-- add rules
add_rules("mode.debug", "mode.releasedbg")
add_rules("plugin.vsxmake.autoupdate")
-- set policies
set_policy("package.requires_lock", true)
-- add repositories
add_repositories("my-repo https://github.com/psych0v0yager/xmake-repo.git dev")
-- require packages
add_requires("commonlibsse-ng 9b7c386d0355e756b4153416a76b0532f755f8de", { configs = { skyrim_vr = false }, repo = "my-repo" })
-- targets
target("template-plugin")
-- add packages to target
add_packages("fmt", "spdlog", "commonlibsse-ng")
-- add commonlibsse-ng plugin
add_rules("@commonlibsse-ng/plugin", {
name = "template-plugin",
author = "Qudix",
description = "SKSE64 plugin template using CommonLibSSE-NG"
})
-- add src files
add_files("src/**.cpp")
add_headerfiles("src/**.h")
add_includedirs("src")
set_pcxxheader("src/pch.h")
-- copy build files to MODS or SKYRIM paths (remove if not needed)
after_build(function(target)
local copy = function(env, ext)
for _, env in pairs(env:split(";")) do
if os.exists(env) then
local plugins = path.join(env, ext, "SKSE/Plugins")
os.mkdir(plugins)
os.trycp(target:targetfile(), plugins)
os.trycp(target:symbolfile(), plugins)
end
end
end
if os.getenv("SKYRIM_MODS_PATH") then
copy(os.getenv("SKYRIM_MODS_PATH"), target:name())
elseif os.getenv("SKYRIM_PATH") then
copy(os.getenv("SKYRIM_PATH"), "Data")
end
end)