-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate-sdk.lua
155 lines (123 loc) · 4.93 KB
/
generate-sdk.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
function sleep(a)
local sec = tonumber(os.clock() + a);
while (os.clock() < sec) do end
end
workspace "PicturaSDK"
architecture "x86_64"
startproject "PicturaDemo"
configurations {"Debug", "Release"}
flags {"MultiProcessorCompile"}
if (os.target() == "windows") then outputDirName = "Windows" end
if (os.target() == "macosx") then outputDirName = "MacOS" end
if (os.target() == "unix") then outputDirName = "Unix" end
if (os.target() == "linux") then outputDirName = "Linux" end
if (os.target() == "bsd") then outputDirName = "BSD" end
print("Generating Pictura SDK project files...")
print("Creating framework output directory...")
os.mkdir("./Framework")
print("Creating intermediate directory...")
os.mkdir("./Intermediate")
filter "system:windows"
system "Windows"
platforms {"Win64"}
filter "system:linux"
system "Linux"
platforms {"Linux"}
filter "system:macosx"
system "macosx"
platforms {"MacOS"}
-- Include directories relative to root folder (solution directory)
IncludeDir = {}
-- Pictura SDK project --
project "PicturaFramework"
location "Sources"
kind "StaticLib"
language "C++"
cppdialect "C++17"
staticruntime "on"
systemversion "latest"
targetname("Pictura-%{cfg.buildcfg}")
print("Target system : " .. outputDirName);
targetdir("Framework/" .. outputDirName .. "/")
objdir("Intermediate/%{prj.name}/" .. outputDirName .. "/")
libdirs {"Libraries/**"}
pchheader "PicturaPCH.h"
pchsource "Sources/PicturaPCH.cpp"
files {"./Sources/**.h", "./Sources/**.cpp"}
defines {"_CRT_SECURE_NO_WARNINGS"}
includedirs {"./Sources", "./Libraries"}
functionlevellinking "on"
filter "system:windows"
system "Windows"
platforms {"Win64"}
linkoptions {"/ignore:4006"}
filter "system:linux"
system "Linux"
platforms {"Linux"}
links {"pthread"}
buildoptions {"-pthread", "-lpthread"}
filter "system:macosx"
system "macosx"
platforms {"MacOS"}
links {"pthread"}
buildoptions {"-pthread", "-lpthread"}
filter "configurations:Debug"
defines "PICTURA_DEBUG"
links {"vulkan-1", "ShaderConductor", "SPIRV-Tools", "SPIRV-Tools-opt", "spirv-cross-cored"}
runtime "Debug"
symbols "on"
filter "configurations:Release"
defines "PICTURA_RELEASE"
links {"vulkan-1", "ShaderConductor", "SPIRV-Tools", "SPIRV-Tools-opt", "spirv-cross-core"}
runtime "Release"
optimize "on"
-- Pictura Demo project --
project "PicturaDemo"
location "Examples/%{prj.name}/Sources"
kind "WindowedApp"
language "C++"
cppdialect "C++17"
staticruntime "on"
systemversion "latest"
targetname("%{prj.name}-%{cfg.buildcfg}")
targetdir("Examples/%{prj.name}/Build/" .. outputDirName .. "/")
objdir("Examples/%{prj.name}/Intermediate/" .. outputDirName .. "/")
files {
"./Examples/%{prj.name}/Sources/**.h",
"./Examples/%{prj.name}/Sources/**.cpp"
}
includedirs {"./Sources", "./Libraries"}
links {"PicturaFramework"}
postbuildcommands {
"{ECHO} Copying application ressources...",
"{RMDIR} %{prj.location}../Build/" .. outputDirName .. "/Ressources",
"{MKDIR} %{prj.location}../Build/" .. outputDirName .. "/Ressources",
"{MKDIR} %{prj.location}../Build/" .. outputDirName .. "/Ressources/Shaders",
"{MKDIR} %{prj.location}../Build/" .. outputDirName .. "/Ressources/Icons",
"{MKDIR} %{prj.location}../Build/" .. outputDirName .. "/Ressources/Fonts",
"{MKDIR} %{prj.location}../Build/" .. outputDirName .. "/Ressources/Languages",
"{COPY} %{prj.location}/../Ressources/Shaders/ %{prj.location}/../Build/" .. outputDirName.. "/Ressources/Shaders/",
"{ECHO} Application ressources copied !"
}
filter "system:windows"
system "Windows"
platforms {"Win64"}
filter "system:linux"
system "Linux"
platforms {"Linux"}
links {"pthread"}
filter "system:macosx"
system "macosx"
platforms {"MacOS"}
links {"pthread"}
filter "configurations:Debug"
defines "APPLICATION_DEBUG"
debugdir "%{cfg.linktarget.directory}"
runtime "Debug"
symbols "on"
optimize "off"
filter "configurations:Release"
defines "APPLICATION_RELEASE"
debugdir "%{cfg.linktarget.directory}"
runtime "Release"
optimize "speed"