-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpremake5.lua
More file actions
114 lines (98 loc) · 3.13 KB
/
Copy pathpremake5.lua
File metadata and controls
114 lines (98 loc) · 3.13 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
------------------------------------------------------------------------------
-- Custom options
------------------------------------------------------------------------------
newoption
{
trigger = "gfxapi",
value = "Graphics API",
description = "Choose a graphics API (vulkan, dx12, metal or dummy)",
allowed =
{
{ "vulkan", "Vulkan graphics API (windows, linux, macosx)" },
{ "dx12", "DirectX 12 (windows)" },
{ "metal", "Metal (macosx)" },
{ "dummy", "No GraphicsAPI, passthrough function calls. (windows, linux, macosx)" },
}
}
OBSIDIAN_GRAPHICS_API = _OPTIONS["gfxapi"] or "vulkan"
newoption
{
trigger = "dm",
value = "Display Manager",
description = "Choose the display manager for linux (wayland or x11)",
allowed =
{
{ "wayland", "Wayland" },
{ "x11", "X11" },
}
}
if os.target() == "linux" then
if _OPTIONS["dm"] then
OBSIDIAN_DISPLAY_MANAGER = _OPTIONS["dm"]
else
if os.getenv("WAYLAND_DISPLAY") then
OBSIDIAN_DISPLAY_MANAGER = "wayland"
else
OBSIDIAN_DISPLAY_MANAGER = "x11"
end
end
end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Utils
------------------------------------------------------------------------------
function local_require(path)
return dofile(path)
end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Bug fixes
------------------------------------------------------------------------------
-- Visual Studio: Bugfix for C++ Modules (same module file name per project)
-- https://github.com/premake/premake-core/issues/2177
require("vstudio")
premake.override(premake.vstudio.vc2010.elements, "clCompile", function(base, prj)
local m = premake.vstudio.vc2010
local calls = base(prj)
if premake.project.iscpp(prj) then
table.insertafter(calls, premake.xmlDeclaration, function()
premake.w('<ModuleDependenciesFile>$(IntDir)\\%%(RelativeDir)</ModuleDependenciesFile>')
premake.w('<ModuleOutputFile>$(IntDir)\\%%(RelativeDir)</ModuleOutputFile>')
premake.w('<ObjectFileName>$(IntDir)\\%%(RelativeDir)</ObjectFileName>')
end)
end
return calls
end)
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Solution
------------------------------------------------------------------------------
MacOSVersion = "14.5"
OutputDir = "%{cfg.buildcfg}-%{cfg.system}"
workspace "Obsidian"
architecture "x86_64"
startproject "Sandbox"
configurations
{
"Debug",
"Release",
"Dist"
}
flags
{
"MultiProcessorCompile"
}
group "Dependencies"
include "vendor/GLFW"
include "vendor/tracy"
if OBSIDIAN_GRAPHICS_API == "dx12" then
include "vendor/DirectX"
end
include "vendor/shaderc"
include "vendor/SPIRV-Cross"
group ""
group "Obsidian"
include "Obsidian"
group ""
include "Sandbox"
------------------------------------------------------------------------------