-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathpremake4.lua
83 lines (68 loc) · 2.2 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
project "vphysics"
language "C++"
kind "SharedLib"
-- Visual studio specific copy command
configuration { "windows", "vs*" }
if GEN_POSTBUILDCOMMANDS then
postbuildcommands {
'if defined VPHYSICS_GAME_PATH (\n'
.. ' if exist "%VPHYSICS_GAME_PATH%\bin\$(TargetFileName)" (\n'
.. ' attrib -r "%VPHYSICS_GAME_PATH%\bin\$(TargetFileName)"\n'
.. ' del "%VPHYSICS_GAME_PATH%\bin\$(TargetFileName)"\n'
.. ' )\n'
.. ' \n'
.. ' copy "$(TargetPath)" "%VPHYSICS_GAME_PATH%\bin\$(TargetFileName)"\n'
.. ')\n'
}
end
linkoptions { "/NODEFAULTLIB:\"LIBCMT\"" }
-- Part of a rediculous hack to get source sdk to build
configuration { "linux", "gmake" }
targetname "vphysics_srv"
targetprefix ""
buildoptions { "-w", "-fpermissive" }
defines { "sprintf_s=snprintf", "strcmpi=strcasecmp", "_alloca=alloca", "stricmp=strcasecmp", "_stricmp=strcasecmp", "strcpy_s=strncpy", "_strnicmp=strncasecmp", "strnicmp=strncasecmp", "_snprintf=snprintf", "_vsnprintf=vsnprintf", "_alloca=alloca", "strcmpi=strcasecmp", "NO_MALLOC_OVERRIDE" }
configuration {}
links { "BulletCollision", "BulletDynamics", "LinearMath", "BulletSoftBody", "BulletMultiThreaded" }
if _PREMAKE_VERSION == "4.4" then
vpaths {
["Header Files"] = "**.h",
["Source Files"] = "**.cpp",
["Resource Files"] = {"**.rc", "resource.h"},
}
end
includedirs {
SDK_DIR,
SDK_DIR .. "/public",
SDK_DIR .. "/public/tier0",
SDK_DIR .. "/public/tier1",
"../bullet/src",
"../include"
}
configuration { "windows" }
libdirs {
SDK_DIR .. "/lib/public",
}
links { "tier0", "tier1", "tier2", "vstdlib", "mathlib" }
configuration { "linux", "gmake" }
-- SRCDS_BIN_DIR is nil on windows, and this code runs anyways :(
if os.is("linux") then
libdirs {
SDK_DIR .. "/lib/linux",
SRCDS_BIN_DIR,
}
-- GCC is terrible with static vs. dynamic
-- FIXME: This doesn't work at all!
linkoptions {
"-static",
"\"" .. path.getabsolute(SDK_DIR) .. "/lib/linux/libtier1_i486.a\"",
"\"" .. path.getabsolute(SDK_DIR) .. "/lib/linux/libmathlib_i486.a\"",
"\"" .. path.getabsolute(SRCDS_BIN_DIR) .. "/libtier0_srv.so\"",
"\"" .. path.getabsolute(SRCDS_BIN_DIR) .. "/libvstdlib_srv.so\"",
}
end
configuration {}
files {
"**.cpp",
"**.h"
}