-
Notifications
You must be signed in to change notification settings - Fork 9
/
premake_sfml.lua
97 lines (83 loc) · 1.77 KB
/
premake_sfml.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
function GetSFMLOptions()
newoption {
trigger = "sfmlinc",
value = "path",
description = "Specify SFML include directory"
}
newoption {
trigger = "sfmllib",
value = "path",
description = "Specify SFML lib directory"
}
newoption {
trigger = "sfml-link-dynamic",
description = "Choose to dynamically link SFML libraries with the executables"
}
if not _OPTIONS["sfmlinc"] then
print("Warning: The path to SFML include directory must be specified using --sfmlinc=<path>")
end
if not _OPTIONS["sfmllib"] then
print("Warning: The path to SFML include directory must be specified using --sfmllib=<path>")
end
end
function IncludeSFML()
includedirs { _OPTIONS["sfmlinc"] }
if not _OPTIONS["sfml-link-dynamic"] then
defines { "SFML_STATIC" }
end
end
function LinkSFML()
libdirs { _OPTIONS["sfmllib"] }
if _OPTIONS["sfml-link-dynamic"] then
filter "configurations:Development"
links {
"sfml-system",
"sfml-window",
"sfml-graphics",
"sfml-audio"
}
filter "configurations:Debug"
links {
"sfml-system-d",
"sfml-window-d",
"sfml-graphics-d",
"sfml-audio-d"
}
else
filter "configurations:Development"
links {
"sfml-system-s",
"sfml-window-s",
"sfml-graphics-s",
"sfml-audio-s"
}
filter "configurations:Debug"
links {
"sfml-system-s-d",
"sfml-window-s-d",
"sfml-graphics-s-d",
"sfml-audio-s-d"
}
filter "configurations:Development or Debug"
links {
"winmm",
"gdi32",
"openal32",
"flac",
"vorbisenc",
"vorbisfile",
"vorbis",
"ogg",
"freetype"
}
filter()
end
filter()
end
function LinkGL()
filter "system:windows"
links { "OpenGL32" }
filter "system:not windows"
links { "GL" }
filter()
end