-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
80 lines (64 loc) · 2.32 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
workspace "VulkanTutorial"
architecture "x64"
configurations { "Debug", "Release" }
include "dependencies/GLFW"
VULKAN_SDK_PATH = os.getenv("VK_SDK_PATH")
if os.istarget "windows" then
GLSLC = VULKAN_SDK_PATH .. "/Bin/glslc.exe"
--CMAKE = ('"'..os.capture("where cmake")..'"') or path.join(os.getenv("CMAKE_PATH"), "cmake")
--OBJCOPY = "%{wks.location}/vendor/bin/binutils-x64/objcopy.exe"
--UTF_BOM_REMOVE = "%{wks.location}/vendor/bin/utf-bom-utils/Debug/bom_remove.exe"
else
--CMAKE = "cmake"
--OBJCOPY = "objcopy"
end
project "VulkanTest"
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
location "VulkanTest"
targetdir "%{wks.location}/build/bin/%{cfg.buildcfg}-%{cfg.architecture}/%{prj.name}"
objdir "%{wks.location}/build/obj/%{cfg.buildcfg}-%{cfg.architecture}/%{prj.name}"
files {
"%{prj.location}/src/**.h",
"%{prj.location}/src/**.hpp",
"%{prj.location}/src/**.cpp",
"%{wks.location}/dependencies/stb_image/stb_image.h",
"%{wks.location}/dependencies/stb_image/stb_image.cpp",
"%{prj.location}/shaders/**.vert",
"%{prj.location}/shaders/**.frag",
}
includedirs {
"%{wks.location}/dependencies/glm",
"%{wks.location}/dependencies/GLFW/include",
"%{wks.location}/dependencies/stb_image",
"%{VULKAN_SDK_PATH}/Include",
}
libdirs {
"%{VULKAN_SDK_PATH}/Lib",
}
links {
"GLFW",
"vulkan-1",
}
defines {
"VKTUT_USE_GLFW",
}
filter "configurations:Debug"
defines { "DEBUG", "VKTUT_VK_ENABLE_VALIDATION" }
symbols "On"
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
filter "files:**.vert or **.frag"
buildmessage "Compiling shader %{file.name}"
buildcommands {
"%{GLSLC} %{file.relpath} -o %{cfg.targetdir}/%{file.name}.spv",
-- "%{UTF_BOM_REMOVE} %{file.relpath}",
-- "%{OBJCOPY} --input-target binary --output-target pe-x86-64 --binary-architecture i386 %{cfg.objdir}/%{file.name}.spv %{cfg.objdir}/%{file.name}.obj",
-- "{ECHO} Created %{cfg.objdir}/%{file.basename}.obj from %{file.relpath}"
}
buildoutputs {
"%{cfg.targetdir}/%{file.name}.spv",
-- "%{cfg.objdir}/%{file.name}.obj"
}