-
Notifications
You must be signed in to change notification settings - Fork 1
/
xmake.lua
35 lines (28 loc) · 1.05 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
set_project("OpenGLFramework")
set_version("1.1")
set_xmakever("2.6.1")
add_rules("mode.debug", "mode.release", "mode.releasedbg")
add_rules("plugin.vsxmake.autoupdate")
set_languages("cxx20")
add_cxxflags("-Wall")
on_load(function (target)
local projectDir = os.projectdir()
local scriptDir = target:scriptdir()
local relativeDir = path.relative(scriptDir, projectDir)
target:set("targetdir", path.join("$(buildir)", "$(plat)", "$(arch)", "$(mode)", relativeDir))
-- the root dir, don't set group
if(relativeDir == ".") then
return
end
local relativeDirWithoutBackslash, _ = string.gsub(relativeDir, "\\", "/")
target:set("group", relativeDirWithoutBackslash)
end)
-- disable other sources.
add_requires("catch2", { system = false, optional = true })
-- add opengl-related library.
add_requires("glfw", "glad", "glm", "assimp", "stb")
add_requires("imgui", {configs={glfw_opengl3 = true}})
-- add global libraries
add_packages("catch2", "glfw", "glad", "glm", "assimp", "imgui", "stb")
includes("src")
includes("examples")