-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmake.lua
More file actions
49 lines (42 loc) · 1.17 KB
/
Copy pathxmake.lua
File metadata and controls
49 lines (42 loc) · 1.17 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
set_languages("c++23")
set_project("MyGame")
set_version("0.1.0")
set_policy("build.c++.modules", true)
add_repositories("local-repo .")
add_rules("plugin.compile_commands.autoupdate", {
outputdir = ".",
lsp = "clangd"
})
add_requires("godotcpp4")
if is_mode("debug") then
add_defines('_DEBUG_MODE')
set_symbols("debug")
set_optimize("none")
elseif is_mode("release") then
add_defines('_RELEASE_MODE')
set_optimize("fastest")
set_symbols("hidden")
set_strip("all")
set_policy("build.optimization.lto", true)
set_policy("check.auto_ignore_flags", false)
end
-- Set better linkers, if found
on_load(function (target)
import("lib.detect.find_program")
if find_program("mold") then
target:add("ldflags", "-fuse-ld=mold")
target:add("shflags", "-fuse-ld=mold")
elseif find_program("lld") then
target:add("ldflags", "-fuse-ld=lld")
target:add("shflags", "-fuse-ld=lld")
end
end)
target("Template")
set_kind("shared")
add_files("src/**.cpp")
if is_mode("debug") then
set_targetdir("godot/bin/debug")
else
set_targetdir("godot/bin/release")
end
add_packages("godotcpp4")