Repository navigation
Expand file tree
/
Copy pathpremake5.lua
More file actions
153 lines (129 loc) · 4.19 KB
/
Copy pathpremake5.lua
File metadata and controls
153 lines (129 loc) · 4.19 KB
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
include "Premake/custom.lua"
external_ue = "External/UE"
external_agilitysdk = "External/AgilitySDK"
external_pix = "External/WinPixEventRuntime"
external_metalcpp = "External/metal-cpp"
external_shaderConductor = "External/ShaderConductor"
external_magicenum = "External/magic_enum"
external_python = "External/Python"
external_shaderc = "External/shaderc"
external_vulkan = "External/Vulkan"
external_fbx = "External/Fbx"
project_shaderHelper = "Source/ShaderHelper"
project_frameWork = "Source/FrameWork"
project_unitTestUtil = "Source/Tests/UnitTestUtil"
project_unitTestGpuApi = "Source/Tests/UnitTestGpuApi"
newoption {
trigger = "UniversalBinary",
description = "Build universal app that supports arm64 and x86",
}
workspace "ShaderHelper"
configurations
{
"Debug",
"Shipping" --RelWithDebInfo
}
targetname "%{prj.name}"
targetdir ("Binaries")
language "C++"
cppdialect "C++20"
staticruntime "off"
objdir ("Intermediate/%{prj.name}")
symbols "On"
startproject "ShaderHelper"
includedirs { "Resource/Shaders"}
filter "system:windows"
architecture "x86_64"
systemversion "latest"
runtime "Release"
implibdir ("%{cfg.objdir}/%{cfg.buildcfg}")
workspace_items
{
"Resource/Shaders",
["Visualizers"] = { "External/UE/Unreal.natvis"},
}
buildoptions
{
"/utf-8",
"/Zc:__cplusplus",
"/bigobj"
--https://devblogs.microsoft.com/cppblog/improving-the-state-of-debug-performance-in-c/
--msvc c++20 implicitly contains /permissive-
--"/permissive-", --implicitly contains "/Zc:hiddenFriend" "/Zc:strictStrings"
}
linkoptions
{
"/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib",
}
defines
{
"NDEBUG",
}
filter "system:macosx"
architecture "universal"
xcodebuildsettings {
["MACOSX_DEPLOYMENT_TARGET"] = "10.15",
--This must be set to YES on arm64 mac.
["ENABLE_STRICT_OBJC_MSGSEND"] = "YES",
}
buildoptions
{
"-fvisibility=hidden",
"-fvisibility-inlines-hidden",
"-fno-strict-aliasing",
}
if _OPTIONS["UniversalBinary"] then
xcodebuildsettings {
["ARCHS"] = "x86_64 arm64",
["ONLY_ACTIVE_ARCH"] = "No",
}
end
filter "system:linux"
architecture "x86_64"
runpathdirs {
"%{cfg.targetdir}",
"%{cfg.targetdir}/../../../ "
}
buildoptions
{
"-fvisibility=hidden",
"-fvisibility-inlines-hidden",
"-fno-strict-aliasing",
}
filter {"system:macosx","kind:WindowedApp"}
runpathdirs {
"%{cfg.targetdir}/../../../"
}
filter {"system:macosx","kind:SharedLib"}
xcodebuildsettings { ["DYLIB_INSTALL_NAME_BASE"] = "@rpath" }
filter {"system:macosx","files:**/Linux/*.cpp or **/Win/*.cpp"}
flags {"ExcludeFromBuild"}
filter {"system:windows","files:**/Linux/*.cpp or **/Mac/*.cpp or **.mm or **.hlsl"}
flags {"ExcludeFromBuild"}
filter {"system:linux","files:**/Win/*.cpp or **/Mac/*.cpp or **.mm or **.hlsl"}
flags {"ExcludeFromBuild"}
filter {"system:linux"}
toolset "clang"
filter {"configurations:Debug"}
optimize "Off"
filter {"configurations:Shipping"}
optimize "On"
defines "SH_SHIPPING=1"
--Premake can not link the corresponding "SharedLib" project in Xcode when targetname contains build configuration.
filter {"system:windows or linux", "configurations:not Shipping"}
targetsuffix "-%{cfg.buildcfg}"
include(external_ue)
include(external_agilitysdk)
include(external_pix)
include(external_metalcpp)
include(external_shaderConductor)
include(external_magicenum)
include(external_python)
include(external_shaderc)
include(external_vulkan)
include(external_fbx)
include(project_shaderHelper)
include(project_frameWork)
group("Tests")
include(project_unitTestUtil)
include(project_unitTestGpuApi)