-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvsl.project
148 lines (128 loc) · 4.05 KB
/
vsl.project
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
--
-- Microsoft Public License (Ms-PL) - Copyright (c) 2020-2021 Sean Moss
-- This file is subject to the terms and conditions of the Microsoft Public License, the text of which can be found in
-- the 'LICENSE' file at the root of this repository, or online at <https://opensource.org/licenses/MS-PL>.
--
-- Premake solution generation script. Written in Lua.
-- Ensure the Vulkan SDK is available
local VULKAN_SDK = os.getenv('VULKAN_SDK')
if VULKAN_SDK == nil then
print('ERROR: Vulkan SDK path not found on system - install or add to path')
os.exit(-1)
end
print('Found Vulkan SDK at: ' .. VULKAN_SDK)
local VK_MAJ, VK_MIN, VK_REV, VK_PAT = string.match(VULKAN_SDK, '(%d+).(%d+).(%d+).(%d+)')
if (VK_MAJ == nil) or (VK_MIN == nil) or (VK_REV == nil) or (VK_PAT == nil) then
print('ERROR: Cannot detect Vulkan SDK version from path')
os.exit(-2)
end
if (tonumber(VK_MIN) < 2) or (tonumber(VK_REV) < 154) then
print('ERROR: Invalid Vulkan SDK version, 1.2.154 or later required')
os.exit(-3)
end
local VULKAN_LIB = VULKAN_SDK .. '/lib'
local VULKAN_INC = VULKAN_SDK .. '/include'
-- Perform additional dependency downloads
if os.target() == "macosx" then
os.execute("(cd ./lib/macos && chmod +x get_antlr.sh && ./get_antlr.sh)")
end
-- Project Workspace
workspace "VSL"
-- Shared Settings
language "C++"
cppdialect "C++17"
location "build"
configurations { "Static", "Shared", "Debug" }
platforms { "x64" }
architecture "x86_64"
flags { "MultiProcessorCompile", "NoImportLib" }
-- Output Directories
filter { "configurations:Static" }
targetdir "build/bin/Static"
filter { "configurations:Shared" }
targetdir "build/bin/Shared"
filter { "configurations:Debug" }
targetdir "build/bin/Debug"
filter {}
-- Release Settings
filter { "configurations:Debug" }
runtime "Release"
symbols "On"
optimize "Off"
filter { "configurations:not Debug"}
runtime "Release"
symbols "Off"
optimize "Speed"
flags { "LinkTimeOptimization" }
filter {}
-- Compiler/Platform Settings
filter { "system:windows" }
systemversion "latest"
disablewarnings { "4099", "4251", "4275" }
staticruntime "off"
defines { "_CRT_SECURE_NO_WARNINGS" }
filter { "toolset:gcc or clang" }
buildoptions { "-fpermissive", "-fvisibility=hidden", "-fPIC" }
filter {}
-- Shared Defines
defines { "ANTLR4CPP_STATIC", "USE_UTF8_INSTEAD_OF_CODECVT" }
filter { "system:windows" }
defines { "UTF_CPP_CPLUSPLUS=_MSVC_LANG" }
filter {}
-- Library Paths
filter { "system:windows" }
libdirs { "./lib/vs2019", VULKAN_LIB }
filter { "system:linux" }
libdirs { "./lib/linux", VULKAN_LIB }
filter { "system:macos" }
libdirs { "./lib/macos", VULKAN_LIB }
filter {}
-- Compiler Library
project "vsl"
-- Settings
includedirs { "include", "include/antlr4", VULKAN_INC }
defines { "_VSL_BUILD" }
targetname "vsl"
-- Output Types
filter { "configurations:Static or Debug" }
kind "StaticLib"
defines { "VSL_STATIC" }
filter { "configurations:Shared" }
kind "SharedLib"
filter {}
-- Linked Libraries
filter { "toolset:gcc" }
links { "stdc++fs", "pthread" }
filter {}
links { "antlr4-runtime", "shaderc_combined" }
-- Project Files
files {
"vsl/**.hpp",
"vsl/**.h",
"vsl/**.cpp"
}
-- Command Line Tool
project "vslc"
-- Settings
includedirs { "include" }
defines { }
targetname "vslc"
filter { "configurations:Shared" }
kind "None"
filter { "configurations:Static or Debug" }
kind "ConsoleApp"
filter {}
dependson { "vsl" }
links { "vsl" }
-- Static Linking
defines { "VSL_STATIC" }
-- Linked Libraries
filter { "toolset:gcc" }
links { "stdc++fs", "pthread" }
filter {}
links { "antlr4-runtime", "shaderc_combined" }
-- Project files
files {
"vslc/**.hpp",
"vslc/**.cpp"
}