-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
81 lines (66 loc) · 2.79 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
-- linux / osx still get the .dll extension even though yknow, those are the wrong binary suffixes for those OS's
workspace "gmsv_gfwens"
configurations {"Debug", "Release"}
platforms {"x32", "x64"}
project "gmsv_gfwens"
kind "SharedLib"
language "C++"
files { "src/*.cpp", "src/*.h" }
local gmodBaseDir = os.getenv("GMODHEADERS") or ""
local steamworksBaseDir = os.getenv("STEAMWORKS_LIB_BASEDIR") or ""
local hashVersion = function() if os.getenv("GITHUB_SHA") ~= nil then
return string.format("GitHub %s", string.sub(os.getenv("GITHUB_SHA"), 1, 8))
else
return "UNKNOWN-GIT-SHA"
end
end
includedirs { "../gmodheaders/include", "../steamworks", gmodBaseDir, steamworksBaseDir}
targetname ("gmsv_fwens")
targetprefix ""
targetextension ".dll"
filter "configurations:Debug"
defines { "DEBUG", "_CRT_SECURE_NO_WARNINGS", string.format("GFWENS_VERSION=%q", hashVersion()), string.format("GFWENS_BUILD_DATE=%q", os.date("%b %d %Y"))}
symbols "On"
targetdir "bin/debug/"
objdir "bin/debug/"
filter "configurations:Release"
defines { "NDEBUG", "_CRT_SECURE_NO_WARNINGS", string.format("GFWENS_VERSION=%q", hashVersion()), string.format("GFWENS_BUILD_DATE=%q", os.date("%b %d %Y"))}
optimize "On"
symbols "off"
targetdir "bin/release/"
objdir "bin/release/"
filter {"platforms:*32" }
architecture "x86"
filter {"platforms:*64" }
architecture "x86_64"
filter({"system:windows", "platforms:*32"})
targetsuffix("_win32")
if steamworksBaseDir ~= "" then
links {steamworksBaseDir .. "/sdk/redistributable_bin/steam_api.lib"}
else
links { "../steamworks/sdk/redistributable_bin/steam_api.lib"}
end
filter({"system:windows", "platforms:*64"})
targetsuffix("_win64")
if steamworksBaseDir ~= "" then
links {steamworksBaseDir .."/sdk/redistributable_bin/win64/steam_api64.lib"}
else
links { "../steamworks/sdk/redistributable_bin/win64/steam_api64.lib"}
end
filter({"system:linux", "platforms:*32"})
targetsuffix("_linux")
if steamworksBaseDir ~= "" then
libdirs {steamworksBaseDir .. "/sdk/redistributable_bin/linux32/"}
else
libdirs {"../steamworks/sdk/redistributable_bin/linux32/"}
end
links {"steam_api"}
filter({"system:linux", "platforms:*64"})
targetsuffix("_linux64")
if steamworksBaseDir ~= "" then
libdirs {steamworksBaseDir .. "/sdk/redistributable_bin/linux64/"}
else
libdirs {"../steamworks/sdk/redistributable_bin/linux64/"}
end
links {"steam_api"}
filter {}