forked from GrimshawA/Nephilim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake4.lua
137 lines (112 loc) · 3.37 KB
/
premake4.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
-- Nephilim Engine Premake Script
local libname = "nephilim"
local enginename = "NephilimEngine"
local action = _ACTION or ""
local version = "0.8.3"
local samplelist = { "samplebox", "LD26Kinectic", "SampleBasic" , "SampleAnimation", "SampleCameras", "SampleFileSystem", "SampleGeometry", "SampleKinesisPhysics", "SampleLighting", "SampleRenderTexture", "SampleScripting", "SampleShaders", "SampleSprites", "SampleUI" }
newoption {
trigger = "no-samples",
description = "Don't generate sample projects."
}
newoption {
trigger = "android",
description = "Configures for an android compilation under vs-android."
}
newoption {
trigger = "outdir",
value = "path",
description = "Changes the output directory of the project files"
}
newoption {
trigger = "lib",
value = "path",
description = "Link to libraries in the path"
}
newoption {
trigger = "gles2",
description = "Prefer GLES 2.0 where applicable"
}
local builddir = action
if _OPTIONS["outdir"] then
builddir = _OPTIONS["outdir"]
end
solution (enginename)
location("build/" .. builddir)
configurations { "Debug", "Release" }
defines ( "ENGINE_VERSION_STRING=" .. version)
defines { "MINIMAL_BUILD" }
project (enginename)
language "C++"
kind "StaticLib"
includedirs { "include" , "includeext"}
files { "source/*.cpp" }
files { "includeext/AS/AS*.cpp" }
files { "include/Nephilim/*.h" }
targetdir("lib")
flags { "Unicode" }
if table.contains(_ARGS, "--android") then
if string.find(action, "vs*") then
print("Android with Visual Studio detected, vs-android must be installed!\nChange the platform to Android and compile!")
end
targetextension ".a"
end
configuration "Debug"
defines { "_DEBUG" , "DEBUG" }
flags { "Symbols" }
targetname(libname .. "-d")
configuration "Release"
targetname(libname)
flags { "Optimize" }
-- Prepare the sample projects
if not table.contains(_ARGS, "--no-samples") then
for i=1 , # samplelist do
local sample = samplelist[i]
project (sample)
language "C++"
kind "ConsoleApp"
location("build/" .. builddir)
vpaths { ["Headers"] = "**.h" }
vpaths { ["Source"] = "**.cpp" }
files { "samples/" .. sample .. "/source/*" }
includedirs { "include" , "includeext"}
links (enginename)
targetdir "bin"
if os.get() == "windows" and not table.contains(_ARGS, "--android") then
links("opengl32")
end
if os.get() == "linux" then
links("sfml-system")
links("sfml-window")
links("sfml-graphics")
links("angelscript")
links("sigc++")
links("GLEW")
end
configuration "Debug"
flags { "Symbols" }
if os.isdir("LibExt") then
libdirs { "LibExt/" .. builddir }
links("sfml-system-s-d")
links("sfml-window-s-d")
links("sfml-graphics-s-d")
links("angelscript-d")
links("libsigcpp-d")
end
-- Debug Android
if table.contains(_ARGS, "--android") then
if table.contains(_ARGS, "--gles2") then linkoptions ( "-lGLESv2" ) else linkoptions ( "-lGLESv1_CM" ) end
if _OPTIONS["lib"] then libdirs (_OPTIONS["lib"])
linkoptions { "-lsigc++-d" }
end
end
configuration "Release"
flags { "Optimize" }
if os.isdir("LibExt") then
links("sfml-system-s")
links("sfml-window-s")
links("sfml-graphics-s")
links("angelscript")
links("libsigcpp")
end
end
end