forked from danielga/gm_crypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpremake5.lua
119 lines (100 loc) · 3.39 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
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
PROJECT_GENERATOR_VERSION = 2
newoption({
trigger = "compile-cryptopp",
description = "Compile cryptopp along with the modules"
})
newoption({
trigger = "gmcommon",
description = "Sets the path to the garrysmod_common (https://github.com/danielga/garrysmod_common) directory",
value = "path to garrysmod_common directory"
})
local gmcommon = assert(_OPTIONS.gmcommon or os.getenv("GARRYSMOD_COMMON"),
"you didn't provide a path to your garrysmod_common (https://github.com/danielga/garrysmod_common) directory")
include(gmcommon)
local SOURCE_DIRECTORY = "source"
local CRYPTOPP_DIRECTORY = "cryptopp"
CreateWorkspace({name = "crypt"})
warnings("Off")
CreateProject({serverside = true, manual_files = true})
IncludeLuaShared()
defines("CRYPTOPP_ENABLE_NAMESPACE_WEAK=1")
includedirs({
SOURCE_DIRECTORY .. "/common",
SOURCE_DIRECTORY .. "/module"
})
files({
SOURCE_DIRECTORY .. "/common/*.hpp",
SOURCE_DIRECTORY .. "/common/*.cpp",
SOURCE_DIRECTORY .. "/module/*.hpp",
SOURCE_DIRECTORY .. "/module/*.cpp"
})
filter({"system:windows", "options:not compile-cryptopp"})
includedirs(CRYPTOPP_DIRECTORY .. "/include")
libdirs(CRYPTOPP_DIRECTORY .. "/lib")
links("cryptopp")
filter({"system:linux or macosx", "options:not compile-cryptopp"})
linkoptions("-Wl,-Bstatic,-lcryptopp,-Bdynamic")
filter("options:compile-cryptopp")
includedirs(CRYPTOPP_DIRECTORY .. "/include")
links("cryptopp")
CreateProject({serverside = false, manual_files = true})
IncludeLuaShared()
defines("CRYPTOPP_ENABLE_NAMESPACE_WEAK=1")
includedirs({
SOURCE_DIRECTORY .. "/common",
SOURCE_DIRECTORY .. "/module"
})
files({
SOURCE_DIRECTORY .. "/common/*.hpp",
SOURCE_DIRECTORY .. "/common/*.cpp",
SOURCE_DIRECTORY .. "/module/*.hpp",
SOURCE_DIRECTORY .. "/module/*.cpp"
})
filter({"system:windows", "options:not compile-cryptopp"})
includedirs(CRYPTOPP_DIRECTORY .. "/include")
libdirs(CRYPTOPP_DIRECTORY .. "/lib")
links("cryptopp")
filter({"system:linux or macosx", "options:not compile-cryptopp"})
linkoptions("-Wl,-Bstatic,-lcryptopp,-Bdynamic")
filter("options:compile-cryptopp")
includedirs(CRYPTOPP_DIRECTORY .. "/include")
links("cryptopp")
if _OPTIONS["compile-cryptopp"] then
project("cryptopp")
kind("StaticLib")
includedirs({
CRYPTOPP_DIRECTORY .. "/include/cryptopp",
CRYPTOPP_DIRECTORY .. "/src"
})
files({
CRYPTOPP_DIRECTORY .. "/include/cryptopp/*.h",
CRYPTOPP_DIRECTORY .. "/src/*.cpp"
})
vpaths({
["Header files"] = CRYPTOPP_DIRECTORY .. "/*.h",
["Source files"] = CRYPTOPP_DIRECTORY .. "/*.cpp"
})
filter("configurations:Release")
defines("NDEBUG")
end
project("testing")
kind("ConsoleApp")
includedirs(SOURCE_DIRECTORY .. "/common")
files({
SOURCE_DIRECTORY .. "/common/*.hpp",
SOURCE_DIRECTORY .. "/common/*.cpp",
SOURCE_DIRECTORY .. "/testing/*.cpp"
})
vpaths({
["Header files/*"] = SOURCE_DIRECTORY .. "/*.hpp",
["Source files/*"] = SOURCE_DIRECTORY .. "/*.cpp"
})
filter({"system:windows", "options:not compile-cryptopp"})
includedirs(CRYPTOPP_DIRECTORY .. "/include")
libdirs(CRYPTOPP_DIRECTORY .. "/lib")
links("cryptopp")
filter({"system:linux or macosx", "options:not compile-cryptopp"})
linkoptions("-Wl,-Bstatic,-lcryptopp,-Bdynamic")
filter("options:compile-cryptopp")
includedirs(CRYPTOPP_DIRECTORY .. "/include")
links("cryptopp")