-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmake.lua
39 lines (26 loc) · 1.35 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
set_project("Cherno_Hazel")
set_allowedarchs("windows|x64")-- 仅允许windows平台x64架构下编译
-- set_allowedmodes("debug", "release", "dist")
set_languages("c17", "cxx20")
-- add_rules("plugin.vsxmake.autoupdate")
add_rules("mode.debug", "mode.releasedbg","mode.release")
target("Cherno_Hazel")
set_kind("shared")
-- set_extension(".dll")
set_pcxxheader("Cherno_Hazel/src/hzpch.h")-- 预编译头文件
set_targetdir("bin/$(mode)-$(arch)/Cherno_Hazel/")
set_objectdir("bin-int/$(mode)-$(arch)/Cherno_Hazel/")
add_includedirs("Cherno_Hazel/vendor/spdlog/include","Cherno_Hazel/src", {public = true}) -- 通过额外的{public|interface = true}属性设置,将includedirs导出给依赖的子target `Sandbox`
add_files("Cherno_Hazel/src/**.cpp")
add_headerfiles("Cherno_Hazel/src/(**.h)", {install = false}) -- 保留目录结构,并禁用默认的头文件安装,仅用于 vs project 文件列表展示、编译
if is_plat("windows") then
add_defines("HZ_PLATFORM_WINDOWS", "HZ_BUILD_DLL")
end
target("Sandbox")
set_kind("binary")
set_targetdir("bin/$(mode)-$(arch)/Sandbox/")
set_objectdir("bin-int/$(mode)-$(arch)/Sandbox/")
add_deps("Cherno_Hazel")
add_files("Sandbox/src/**.cpp")
add_headerfiles("Sandbox/src/(**.h)", {install = false})
add_defines("HZ_PLATFORM_WINDOWS")