-
Notifications
You must be signed in to change notification settings - Fork 34
/
premake5.lua
111 lines (89 loc) · 3.22 KB
/
premake5.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
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
name = "vkhr"
workspace (name)
language "C++"
location "build"
warnings "Extra"
cppdialect "C++17"
configurations { "Debug",
"Release" }
filter "configurations:Debug"
defines "DEBUG"
optimize "Off"
symbols "On"
filter "configurations:Release"
defines "RELEASE"
optimize "Speed"
symbols "On"
floatingpoint "Fast"
filter { "system:windows" }
defines "WINDOWS"
filter { "action:vs*" }
include "utils/wsdk.lua"
startproject "vkhr"
platforms { "Win64" }
debugdir "." -- project root.
-- Don't handle Win32 for now...
-- Premake5 fails to detect SDK.
systemversion(os.winSdk()..".0")
filter "platforms:Win64"
architecture "x86_64"
SDK = "$(VULKAN_SDK)"
GLFW = "foreign/glfw"
EMBREE = "foreign/embree"
-- With MinGW x64, always static link with the default C++ stdlib.
STATIC_LINK = "-static -static-libstdc++ -static-libgcc -lpthread"
project (name)
targetdir "bin"
kind "WindowedApp"
includedirs "include"
files { "include/**.hh" }
files { "src/"..name.."/**.cc" }
files { "src/vkpp/**.cc" }
files "src/main.cc"
os.vpaths() -- Virtual paths.
-- For header-only libraries.
includedirs "foreign/include"
includedirs "foreign/imgui"
includedirs "foreign/examples/"
files { "foreign/imgui/*.h",
"foreign/imgui/imgui_draw.cpp",
"foreign/imgui/imgui_widgets.cpp",
"foreign/imgui/examples/imgui_impl_glfw.cpp",
"foreign/imgui/examples/imgui_impl_glfw.h",
"foreign/imgui/examples/imgui_impl_vulkan.h",
"foreign/imgui/examples/imgui_impl_vulkan.cpp",
"foreign/imgui/imgui.cpp" }
includedirs "foreign/imgui/examples"
includedirs "foreign/json/include"
includedirs "foreign/tinyobjloader"
files { "foreign/tinyobjloader/tiny_obj_loader.cc",
"foreign/tinyobjloader/tiny_obj_loader.h" }
includedirs "foreign/stb"
files { "foreign/stb/*.h" }
files { "foreign/glm/glm/**.hpp" }
includedirs "foreign/glm"
filter { "system:windows", "action:gmake" }
includedirs { SDK.."/include" }
includedirs { EMBREE.."/include" }
includedirs { GLFW.."/include" }
buildoptions { "-fopenmp" }
linkoptions { STATIC_LINK, "-fopenmp", "-mwindows", "-lstdc++fs" }
links { SDK.."/lib/vulkan-1" }
links { GLFW.."/lib/glfw3dll" }
links { EMBREE.."/lib/embree3" }
filter { "system:windows", "action:vs*" }
includedirs { SDK.."/include" }
includedirs { EMBREE.."/include" }
includedirs { GLFW.."/include" }
entrypoint "mainCRTStartup"
buildoptions { "/openmp", "/Zc:twoPhase-" }
disablewarnings { "4201" }
files { GLFW.."/include/GLFW/*.h" }
files { EMBREE.."/include/embree3/*.h" }
links { SDK.."/lib/vulkan-1.lib" }
links { GLFW.."/lib/glfw3dll.lib" }
links { EMBREE.."/lib/embree3.lib" }
filter "system:linux or bsd or solaris"
links { "embree3", "glfw", "vulkan" }
linkoptions { "-fopenmp", "-lstdc++fs" }
buildoptions { "-fopenmp" }