-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxmake.lua
71 lines (55 loc) · 1.87 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
69
70
71
set_xmakever("2.9.7")
add_rules("mode.debug", "mode.release")
set_allowedmodes("debug", "release")
-- Project name and version
set_project("Ryu")
set_version("0.0.3")
-- Set C/C++ language version
set_languages("c17", "cxx23")
-- Include other xmake scripts
add_moduledirs("Xmake/Modules")
includes("Xmake/Packages.lua")
includes("Xmake/Rules/RyuPlugin.lua")
includes("Xmake/Rules/ExportAPI.lua")
includes("Xmake/Rules/CopyToBuildDir.lua")
includes("Xmake/Rules/AddScriptPathDefine.lua")
includes("Xmake/Rules/EnumAutogen.lua")
-- Build debug mode by default
set_defaultmode("debug")
-- Platform and architecture - only support x64 Windows
set_allowedplats("windows")
set_allowedarchs("windows|x64")
-- Only allow MSVC
set_toolchains("msvc")
-- Enable all warnings and handle them as compilation errors
set_policy("build.warning", true)
set_warnings("all", "extra")
-- Set policies
set_policy("run.autobuild", true)
set_policy("build.intermediate_directory", true)
set_policy("package.requires_lock", false)
set_policy("build.always_update_configfiles", false)
if is_mode("debug") then
-- Enable preprocessor markers in debug mode
set_policy("preprocessor.linemarkers", true)
add_defines("RYU_BUILD_DEBUG")
-- Enable hot reloading
set_symbols("debug", "edit")
end
if is_mode("release") then
set_symbols("hidden")
set_strip("all")
end
add_defines("UNICODE", "_UNICODE", "NOMINMAX", "NOMCX", "NOSERVICE", "NOHELP", "WIN32_LEAN_AND_MEAN")
add_links("user32.lib")
--set_runtimes(is_mode("debug") and "MDd" or "MD")
-- Bring standard types namespace to global namespace
if has_config("use-std-types-globally") then
add_defines("RYU_USING_STD_TYPES_GLOBALLY")
end
-- Add compilation success to all targets
add_tests("CompileSuccess", { build_should_pass = true, group = "Compilation" })
-- Add rule to export shared library
add_rules("ExportAPI")
-- Include xmake projects
includes("**/xmake.lua")