forked from gameplay3d/gameplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
120 lines (115 loc) · 4.39 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
workspace "gameplay"
local project_action = "UNDEFINED"
if _ACTION ~= nill then project_action = _ACTION end
local platform = "%{cfg.system}-%{cfg.platform}"
local target_dir = path.join(os.getcwd(), "_build/"..platform.."/%{cfg.buildcfg}")
local workspace_dir = path.join(os.getcwd(), "_compiler/"..project_action)
local deps_dir = path.join(os.getcwd(), "_deps")
local vulkan_sdk_dir = os.getenv("VULKAN_SDK")
configurations { "debug", "release" }
startproject "gameplay.editor"
location (workspace_dir)
targetdir (target_dir)
objdir("_build/tmp/%{cfg.system}/%{prj.name}")
symbols "On"
exceptionhandling "On"
rtti "On"
staticruntime "On"
flags { "FatalCompileWarnings", "MultiProcessorCompile", "NoPCH", "UndefinedIdentifiers", "NoIncrementalLink" }
cppdialect "C++17"
systemversion "latest"
filter { "system:windows" }
platforms { "x86_64" }
files { ".editorconfig" }
editandcontinue "Off"
symbols "Full"
buildoptions { "/utf-8", "/bigobj" }
buildoptions { "/permissive-" }
buildoptions { "/WX" }
warnings "Extra"
disablewarnings { "4100", "4127", "4189", "4201", "4251", "4530", "4456", "4458", "26812" }
filter { "system:linux" }
platforms { "x86_64" }
defaultplatform "x86_64"
buildoptions { "-fvisibility=hidden -D_FILE_OFFSET_BITS=64 -fPIC" }
enablewarnings { "all", "vla" }
disablewarnings { "error=unused-variable" }
filter { "system:linux", "configurations:debug" }
buildoptions { "-fstack-protector-strong" }
filter { "platforms:x86_64" }
architecture "x86_64"
filter { "configurations:debug", "system:windows" }
optimize "Off"
filter { "configurations:debug", "system:linux" }
optimize "Off"
filter { "configurations:release" }
defines { "NDEBUG" }
filter { "configurations:release", "system:windows" }
optimize "Speed"
filter { "configurations:release", "system:linux" }
optimize "On"
filter {}
project "gameplay"
kind "SharedLib"
location (workspace_dir.."/%{prj.name}")
defines { "GP_EXPORT" }
includedirs {
"include/gameplay",
"source/gameplay",
vulkan_sdk_dir.."/include",
deps_dir.."/imgui",
deps_dir.."/imgui/backends",
deps_dir.."/freetype/include",
deps_dir.."/spdlog/include",
deps_dir.."/cpptoml/include",
deps_dir.."/stb/include",
deps_dir.."/glfw/include",
deps_dir.."/glm/include",
}
libdirs {
vulkan_sdk_dir.."/lib",
}
links { "freetype", "glfw3" }
filter { "system:windows" }
libdirs {
deps_dir.."/freetype/bin/"..platform.."/%{cfg.buildcfg}",
deps_dir.."/glfw/bin/"..platform.."/%{cfg.buildcfg}",
}
links { "vulkan-1", "opengl32", "user32", "gdi32", "shell32", "kernel32", "pathcch" }
filter { "system:linux" }
libdirs {
deps_dir.."/freetype/bin/"..platform,
deps_dir.."/glfw/bin/"..platform,
}
links { "vulkan", "dl", "pthread", "X11", "z"}
linkoptions { "-export-dynamic" }
buildoptions { "-pthread" }
disablewarnings { "undef", "unused-function", "unused-value", "unused-but-set-variable" }
filter {}
files {
"include/gameplay/*.*",
"source/gameplay/*.*",
deps_dir.."/imgui/*.h",
deps_dir.."/imgui/*.cpp",
deps_dir.."/imgui/backends/imgui_impl_glfw.*",
deps_dir.."/imgui/backends/imgui_impl_vulkan.*",
deps_dir.."/imgui/misc/freetype/imgui_freetype.*",
}
vpaths
{
["imgui"] = deps_dir.."/imgui/**.*",
["include"] = "include/gameplay/*.*",
["source"] = "source/gameplay/*.*",
}
project "gameplay.editor"
dependson( "gameplay" )
kind "ConsoleApp"
location (workspace_dir.."/%{prj.name}")
includedirs("include")
libdirs { target_dir }
links { "gameplay" }
filter { "system:linux" }
links { "dl", "pthread" }
buildoptions { "-pthread" }
filter {}
files { "source/gameplay.editor/*.cpp" }