-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
125 lines (111 loc) · 3.87 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
workspace "Wrenderer"
configurations { "Debug", "Release"}
project "Wrenderer"
language "C++"
targetname "Wrenderer"
architecture "x64"
kind "StaticLib"
outputdir = "%{cfg.system}-%{cfg.architecture}/%{cfg.buildcfg}"
cppdialect "C++17"
targetdir("%{wks.location}/Binaries/" .. outputdir .. "/%{prj.name}")
objdir("%{wks.location}/Binaries/Intermediates/" .. outputdir .. "/%{prj.name}")
files { "include/**.h", "src/**.c", "include/**.hpp", "src/**.cpp" }
libdirs { "./libs/" }
includedirs { "./include/" }
includedirs { "./include/libs/", "./include/libs/fastgltf/include/" }
includedirs { os.getenv("VULKAN_SDK") .. "/Include" }
links { "vulkan-1", "glfw3" }
removefiles { "test/**.**" }
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
links {"fastgltfDEBUG"}
filter ""
filter "configurations:Release"
optimize "On"
symbols "On"
links {"fastgltfRELEASE"}
filter ""
filter "system:windows"
defines { "VK_USE_PLATFORM_WIN32_KHR" }
filter ""
filter "system:linux"
defines { "VK_USE_PLATFORM_XLIB_KHR" }
filter ""
filter "action:gmake"
prebuildcommands {
"mkdir -p" .. " %[%{wks.location}/Binaries/]",
"mkdir -p" .. " %[%{wks.location}/Binaries/Intermediates/]",
"mkdir -p" .. " %[%{wks.location}/Binaries/" .. outputdir .. "]",
"mkdir -p" .. " %[%{wks.location}/Binaries/Intermediates/" .. outputdir .. "]",
}
filter "not action:gmake"
prebuildcommands {
"{MKDIR}" .. " %[%{wks.location}/Binaries/]",
"{MKDIR}" .. " %[%{wks.location}/Binaries/Intermediates/]",
"{MKDIR} %[%{wks.location}/Binaries/" .. outputdir .. "]",
"{MKDIR} %[%{wks.location}/Binaries/Intermediates/" .. outputdir .. "]",
}
filter ""
filter "action:gmake"
toolset "clang"
buildoptions {"-Wextra", "-Wall", "-mavx", "-mavx2"}
filter "not action:gmake"
toolset "msc"
filter""
project "WrenTest"
architecture "x64"
kind "ConsoleApp"
language "C++"
files { "**.h", "**.hpp", "test/**.cpp" }
outputdir = "%{cfg.system}-%{cfg.architecture}/%{cfg.buildcfg}"
cppdialect "C++17"
targetdir("%{wks.location}/Binaries/" .. outputdir .. "/%{prj.name}")
objdir("%{wks.location}/Binaries/Intermediates/" .. outputdir .. "/%{prj.name}")
prebuildcommands {
"compileShaders.bat"
}
libdirs { "./libs/" }
includedirs { "./include/", "./include/libs/", "./include/libs/fastgltf/include/" }
includedirs { os.getenv("VULKAN_SDK") .. "/Include" }
links { "Wrenderer" }
links { "vulkan-1", "glfw3" }
filter "configurations:Debug"
defines {"DEBUG"}
symbols "On"
links {"fastgltfDEBUG"}
filter ""
filter "configurations:Release"
optimize "On"
symbols "On"
links {"fastgltfRELEASE"}
filter ""
filter "system:windows"
defines { "VK_USE_PLATFORM_WIN32_KHR" }
filter ""
filter "system:linux"
defines { "VK_USE_PLATFORM_XLIB_KHR" }
filter ""
filter "action:gmake"
toolset "clang"
buildoptions {"-Wextra", "-Wall"}
links { "user32", "msvcrt", "gdi32", "shell32", "libcmt" }
filter "not action:gmake"
toolset "msc"
filter ""
newaction {
trigger = "clean",
description = "clean the software",
execute = function ()
print("Cleaning")
os.rmdir("./Binaries")
os.remove("./Lib/*.lib")
os.remove("**.make")
os.remove("Makefile")
os.remove("**.vcxproj")
os.remove("**.vcxproj.filters")
os.remove("**.vcxproj.user")
os.remove("**.sln")
print("done.")
end
}