GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BlocksInMotion/premake4.lua at master · BlocksInMotion/BlocksInMotion

Expand file tree

/

premake4.lua

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
243 lines (212 loc) · 6.96 KB
/

premake4.lua

Copy path

File metadata and controls

243 lines (212 loc) · 6.96 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
-- vars
local win_unixenv = false
local cygwin = false
local mingw = false
local clang_libcxx = false
local gcc_compat = false
local cuda = false
local platform = "x32"
local system_includes = ""
-- this function returns the first result of "find basepath -name filename", this is needed on some platforms to determine the include path of a library
function find_include(filename, base_path)
if(os.is("windows") and not win_unixenv) then
return ""
end
local proc = io.popen("find "..base_path.." -name \""..filename.."\"", "r")
local path_names = proc:read("*a")
proc:close()
if(string.len(path_names) == 0) then
return ""
end
local newline = string.find(path_names, "\n")
if newline == nil then
return ""
end
return string.sub(path_names, 0, newline-1)
end
function add_include(path)
system_includes = system_includes.." -isystem "..path
end
-- actual premake info
solution "BlocksInMotion"
configurations { "Release", "Debug" }
configuration "Debug"
links { "a2elightd" }
configuration "Release"
links { "a2elight" }
project "BlocksInMotion"
-- scan args
local argc = 1
while(_ARGS[argc] ~= nil) do
if(_ARGS[argc] == "--env") then
argc=argc+1
-- check if we are building with cygwin/mingw
if(_ARGS[argc] ~= nil and _ARGS[argc] == "cygwin") then
cygwin = true
win_unixenv = true
end
if(_ARGS[argc] ~= nil and _ARGS[argc] == "mingw") then
mingw = true
win_unixenv = true
end
end
if(_ARGS[argc] == "--clang") then
clang_libcxx = true
end
if(_ARGS[argc] == "--gcc") then
gcc_compat = true
end
if(_ARGS[argc] == "--platform") then
argc=argc+1
if(_ARGS[argc] ~= nil) then
platform = _ARGS[argc]
end
end
if(_ARGS[argc] == "--cuda") then
cuda = true
end
argc=argc+1
end
-- project settings
targetname "BlocksInMotion"
kind "ConsoleApp"
language "C++"
files { "src/**.h", "src/**.cpp" }
targetdir "bin"
if(win_unixenv) then
files { "src/win/windows.rc" }
end
-- os specifics
if(not os.is("windows") or win_unixenv) then
if(not cygwin) then
add_include("/usr/include")
else
add_include("/usr/include/w32api")
add_include("/usr/include/w32api/GL")
end
add_include("/usr/local/include")
add_include("/usr/include/libxml2")
add_include("/usr/include/a2elight")
add_include("/usr/local/include/a2elight")
add_include("/usr/include/freetype2")
add_include("/usr/local/include/freetype2")
add_include("/usr/include/bullet")
buildoptions { "-x c++ -std=c++11 -Wall -Wno-trigraphs -Wreturn-type -Wunused-variable -funroll-loops" }
libdirs { "/usr/local/lib" }
if(clang_libcxx) then
buildoptions { "-stdlib=libc++ -integrated-as" }
buildoptions { "-Weverything" }
buildoptions { "-Wno-unknown-warning-option" }
buildoptions { "-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-header-hygiene -Wno-gnu -Wno-float-equal" }
buildoptions { "-Wno-documentation -Wno-system-headers -Wno-global-constructors -Wno-padded -Wno-packed" }
buildoptions { "-Wno-switch-enum -Wno-sign-conversion -Wno-conversion -Wno-exit-time-destructors" }
buildoptions { "-Wno-unused-member-function -Wno-four-char-constants" }
linkoptions { "-fvisibility=default" }
if(not win_unixenv) then
defines { "A2E_EXPORT=1" }
linkoptions { "-stdlib=libc++" }
else
-- must be done before the next link options
linkoptions { "`sdl2-config --libs`" }
-- link against everything that libc++ links to, now that there are no default libs
linkoptions { "-lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt" }
linkoptions { "-nodefaultlibs -stdlib=libc++ -lc++.dll" }
add_include("/usr/include/c++/v1")
end
end
if(gcc_compat) then
buildoptions { "-Wno-strict-aliasing -Wno-multichar" }
end
if(cuda) then
add_include("/usr/local/cuda/include")
add_include("/usr/local/cuda-5.0/include")
defines { "A2E_CUDA_CL=1" }
if(platform == "x64") then
libdirs { "/opt/cuda-toolkit/lib64", "/usr/local/cuda/lib64", "/usr/local/cuda-5.0/lib64" }
else
libdirs { "/opt/cuda-toolkit/lib", "/usr/local/cuda/lib", "/usr/local/cuda-5.0/lib" }
end
links { "cuda", "cudart" }
end
end
if(win_unixenv) then
-- only works with gnu++11 for now ...
buildoptions { "-std=gnu++11" }
defines { "WIN_UNIXENV" }
if(cygwin) then
defines { "CYGWIN" }
end
if(mingw) then
defines { "__WINDOWS__", "MINGW" }
add_include("/mingw/include")
libdirs { "/usr/lib", "/usr/local/lib" }
buildoptions { "-Wno-unknown-pragmas" }
end
end
-- the same for all
includedirs { "src/", "src/ai/", "src/audio/", "src/editor/", "src/game/", "src/map/", "src/physics/", "src/scripting/", "src/ui/" }
if(os.is("linux") or os.is("bsd") or win_unixenv) then
add_include("/usr/include/SDL2")
add_include("/usr/local/include/SDL2")
-- set system includes
buildoptions { system_includes }
libdirs { os.findlib("GL"), os.findlib("xml2") }
links { "OpenCL", "freetype", "mpg123" }
if(not win_unixenv) then
links { "GL", "openal", "SDL2_image", "xml2", "BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath" }
libdirs { os.findlib("SDL2"), os.findlib("SDL2_image") }
buildoptions { "`sdl2-config --cflags`" }
linkoptions { "`sdl2-config --libs`" }
if(clang_libcxx) then
-- small linux workaround for now (linking will fail otherwise):
linkoptions { "-lrt -lc -lstdcxx" }
end
elseif(cygwin) then
-- link against windows opengl libs on cygwin
links { "opengl32", "OpenAL", "SDL2_image.dll", "xml2" }
libdirs { "/lib/w32api" }
buildoptions { "`sdl2-config --cflags | sed -E 's/-Dmain=SDL_main//g'`" }
linkoptions { "`sdl2-config --libs | sed -E 's/(-lmingw32|-mwindows)//g'`" }
elseif(mingw) then
-- link against windows opengl libs on mingw
links { "opengl32", "OpenAL", "SDL2_image", "libxml2" }
buildoptions { "`sdl2-config --cflags | sed -E 's/-Dmain=SDL_main//g'`" }
if(not clang_libcxx) then
linkoptions { "`sdl2-config --libs`" }
end
end
if(gcc_compat) then
if(not mingw) then
defines { "_GLIBCXX__PTHREADS" }
end
defines { "_GLIBCXX_USE_NANOSLEEP", "_GLIBCXX_USE_SCHED_YIELD" }
end
end
-- configs
-- prefer system platform
if(platform == "x64") then
platforms { "x64", "x32" }
else
platforms { "x32", "x64" }
end
configuration { "x64" }
defines { "PLATFORM_X64" }
configuration { "x32" }
defines { "PLATFORM_X86" }
configuration "Debug"
targetname "BlocksInMotiond"
defines { "DEBUG", "A2E_DEBUG" }
flags { "Symbols" }
if(not os.is("windows") or win_unixenv) then
buildoptions { " -gdwarf-2" }
end
if(win_unixenv) then
links { "BulletSoftBody_Debug", "BulletDynamics_Debug", "BulletCollision_Debug", "LinearMath_Debug" }
end
configuration "Release"
targetname "BlocksInMotion"
defines { "NDEBUG" }
flags { "Optimize" }
if(win_unixenv) then
links { "BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath" }
end
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.