forked from novusengine/Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpremake5.lua
More file actions
60 lines (47 loc) · 1.72 KB
/
premake5.lua
File metadata and controls
60 lines (47 loc) · 1.72 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
Engine = { }
Engine.name = "Engine"
Engine.rootDir = ""
Engine.buildDir = ""
Engine.binDir = ""
Engine.isRoot = false
Engine.Init = function(self, rootDir, buildDir, binDir)
print("-- Configuring (" .. self.name .. ") --\n")
self.rootDir = rootDir
self.buildDir = buildDir
self.binDir = binDir .. "/" .. self.name
local projectUtils = path.getabsolute("Premake/ProjectUtil.lua", self.rootDir)
include(projectUtils)
local buildSettings = path.getabsolute("Premake/BuildSettings.lua", self.rootDir)
local silentFailOnDuplicateSetting = not self.isRoot
InitBuildSettings(silentFailOnDuplicateSetting)
include(buildSettings)
print("\n-- Directory Info (" .. self.name .. ") --")
print(" Root Directory : " .. self.rootDir)
print(" Build Directory : " .. self.buildDir)
print(" Bin Directory : " .. self.binDir)
print("--\n")
if self.isRoot then
workspace (self.name)
location (buildDir)
configurations { "Debug", "RelDebug", "Release" }
filter "system:Windows"
system "windows"
platforms "Win64"
filter "system:Unix"
system "linux"
platforms "Linux"
end
local deps = path.getabsolute("Dependencies/Dependencies.lua", self.rootDir)
local projects = path.getabsolute("Source/Projects.lua", self.rootDir)
include(deps)
include(projects)
print("-- Done (" .. self.name .. ") --")
end
if HasRoot == nil then
HasRoot = true
local rootDir = path.getabsolute(".")
local buildDir = path.getabsolute("Build/", rootDir)
local binDir = path.getabsolute("Bin/", buildDir)
Engine.isRoot = true
Engine:Init(rootDir, buildDir, binDir)
end