-
Notifications
You must be signed in to change notification settings - Fork 70
/
premake5.lua
109 lines (91 loc) · 4.52 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
require "./premake"
function PublishBundle( bin )
if os.host() == "windows" then
os.execute("robocopy /njs /nfl /ndl /nc /ns /np /MIR \"Source\\Tools\\Editor\\Icons\\Helium\" \"Bin\\Debug\\Icons\" *.png")
os.execute("robocopy /njs /nfl /ndl /nc /ns /np /MIR \"Source\\Tools\\Editor\\Icons\\Helium\" \"Bin\\Intermediate\\Icons\" *.png")
os.execute("robocopy /njs /nfl /ndl /nc /ns /np /MIR \"Source\\Tools\\Editor\\Icons\\Helium\" \"Bin\\Profile\\Icons\" *.png")
os.execute("robocopy /njs /nfl /ndl /nc /ns /np /MIR \"Source\\Tools\\Editor\\Icons\\Helium\" \"Bin\\Release\\Icons\" *.png")
elseif os.host() == "macosx" then
os.execute("mkdir -p Bin/Debug/" .. Helium.GetBundleResourcePath())
os.execute("mkdir -p Bin/Intermediate/" .. Helium.GetBundleResourcePath())
os.execute("mkdir -p Bin/Profile/" .. Helium.GetBundleResourcePath())
os.execute("mkdir -p Bin/Release/" .. Helium.GetBundleResourcePath())
os.copyfile( "Source/Tools/Editor/Icons/Helium.icns", "Bin/Debug/" .. Helium.GetBundleResourcePath() )
os.copyfile( "Source/Tools/Editor/Icons/Helium.icns", "Bin/Intermediate/" .. Helium.GetBundleResourcePath() )
os.copyfile( "Source/Tools/Editor/Icons/Helium.icns", "Bin/Profile/" .. Helium.GetBundleResourcePath() )
os.copyfile( "Source/Tools/Editor/Icons/Helium.icns", "Bin/Release/" .. Helium.GetBundleResourcePath() )
os.copyfile( "Info.plist", "Bin/Debug/" .. Helium.GetBundleConfigPath() )
os.copyfile( "Info.plist", "Bin/Intermediate/" .. Helium.GetBundleConfigPath() )
os.copyfile( "Info.plist", "Bin/Profile/" .. Helium.GetBundleConfigPath() )
os.copyfile( "Info.plist", "Bin/Release/" .. Helium.GetBundleConfigPath() )
elseif os.host() == "linux" then
os.execute("mkdir -p Bin/Debug/" .. Helium.GetBundleResourcePath() .. "Icons/")
os.execute("mkdir -p Bin/Intermediate/" .. Helium.GetBundleResourcePath() .. "Icons/")
os.execute("mkdir -p Bin/Profile/" .. Helium.GetBundleResourcePath() .. "Icons/")
os.execute("mkdir -p Bin/Release/" .. Helium.GetBundleResourcePath() .. "Icons/")
os.execute("rsync -a --delete Source/Tools/Editor/Icons/Helium/ Bin/Debug/" .. Helium.GetBundleResourcePath() .. "Icons/ --filter='+ */' --filter '+ *.png' --filter='- *'")
os.execute("rsync -a --delete Source/Tools/Editor/Icons/Helium/ Bin/Intermediate/" .. Helium.GetBundleResourcePath() .. "Icons/ --filter='+ */' --filter '+ *.png' --filter='- *'")
os.execute("rsync -a --delete Source/Tools/Editor/Icons/Helium/ Bin/Profile/" .. Helium.GetBundleResourcePath() .. "Icons/ --filter='+ */' --filter '+ *.png' --filter='- *'")
os.execute("rsync -a --delete Source/Tools/Editor/Icons/Helium/ Bin/Release/" .. Helium.GetBundleResourcePath() .. "Icons/ --filter='+ */' --filter '+ *.png' --filter='- *'")
end
end
newoption
{
trigger = "core",
description = "Core components only",
}
newoption
{
trigger = "pch",
description = "Build with precompiled headers",
}
if not _OPTIONS[ "pch" ] then
if os.host() == "windows" then
_OPTIONS[ "pch" ] = true
end
end
newoption
{
trigger = "gfxapi",
value = "API",
description = "Choose a particular 3D API for rendering",
allowed = {
{ "opengl", "OpenGL" },
{ "direct3d", "Direct3D (Windows only)" },
{ "none", "No Renderer" }
}
}
if not _OPTIONS[ "gfxapi" ] then
if os.host() == "windows" then
_OPTIONS[ "gfxapi" ] = "direct3d"
else
_OPTIONS[ "gfxapi" ] = "opengl"
end
end
-- Do nothing if there is no action (--help, etc...)
if _ACTION then
if _ACTION ~= "clean" then
PublishBundle()
end
workspace "Engine"
startproject "Helium-Tools-Editor"
Helium.DoBasicWorkspaceSettings()
filter "configurations:Debug"
targetdir( "Bin/Debug/" .. Helium.GetBundleExecutablePath() )
libdirs { "Bin/Debug/" .. Helium.GetBundleExecutablePath() }
libdirs { "Core/Bin/Debug/" .. Helium.GetBundleExecutablePath() }
filter "configurations:Intermediate"
targetdir( "Bin/Intermediate/" .. Helium.GetBundleExecutablePath() )
libdirs { "Bin/Intermediate/" .. Helium.GetBundleExecutablePath() }
libdirs { "Core/Bin/Intermediate/" .. Helium.GetBundleExecutablePath() }
filter "configurations:Profile"
targetdir( "Bin/Profile/" .. Helium.GetBundleExecutablePath() )
libdirs { "Bin/Profile/" .. Helium.GetBundleExecutablePath() }
libdirs { "Core/Bin/Profile/" .. Helium.GetBundleExecutablePath() }
filter "configurations:Release"
targetdir( "Bin/Release/" .. Helium.GetBundleExecutablePath() )
libdirs { "Bin/Release/" .. Helium.GetBundleExecutablePath() }
libdirs { "Core/Bin/Release/" .. Helium.GetBundleExecutablePath() }
dofile "premake-runtime.lua"
dofile "premake-tools.lua"
end