@@ -26,13 +26,15 @@ local nugetPackages = {
26
26
-- "vorbis-msvc14-x64:1.3.5.7785", "ogg-msvc-x64:1.3.2.8787", -- x64
27
27
}
28
28
29
+ local PATH = os.getenv (" PATH" )
29
30
local SDL2_DIR = os.getenv (" SDL2_DIR" )
30
31
local SDL2_headerPath = os .findheader (" SDL2/SDL.h" , SDL2_DIR )
31
32
local SDL2_libraryPath = os .findlib (" SDL2" , SDL2_DIR )
32
33
local vorbis_headerPath = os .findheader (" vorbis/vorbisenc.h" )
33
34
local ogg_headerPath = os .findheader (" ogg/ogg.h" )
34
35
35
36
print (" premake:" , _PREMAKE_VERSION )
37
+ print (" PATH: " , PATH )
36
38
print (" SDL2_DIR: " , SDL2_DIR )
37
39
print (" SDL2 header path: " , SDL2_headerPath )
38
40
print (" SDL2 library path: " , SDL2_libraryPath )
100
102
101
103
filter { " action:vs*" }
102
104
nuget (nugetPackages )
105
+ filter { " action:not vs*" , " kind:ConsoleApp" }
106
+ links { " SDL2main" }
107
+ filter { " action:not vs*" }
108
+ if vorbis_headerPath then
109
+ includedirsafter { vorbis_headerPath }
110
+ end
111
+ if ogg_headerPath then
112
+ includedirsafter { ogg_headerPath }
113
+ end
114
+ if SDL2_headerPath then
115
+ externalincludedirs { path .join (SDL2_headerPath , " SDL2" ) }
116
+ end
117
+ if SDL2_libraryPath then
118
+ libdirs { SDL2_libraryPath }
119
+ end
120
+ links { " SDL2" , " ogg" , " vorbis" , " vorbisfile" , " vorbisenc" }
103
121
filter { " toolset:msc*" }
104
122
defines { " _CRT_SECURE_NO_WARNINGS" } -- 4996: '$func': This function or variable may be unsafe. Consider using $func2 instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
105
123
defines { " _USE_MATH_DEFINES" } -- for M_PI
@@ -153,21 +171,6 @@ project "resinstaller"
153
171
" 4703" , -- potentially uninitialized local pointer variable '$var' used
154
172
" 4996" , -- '$func': The POSIX name of this item is deprecated. Instead, use the ISO C and C++ conformant name: $func2. See online help for details.
155
173
}
156
- filter " action:not vs*"
157
- if vorbis_headerPath then
158
- includedirsafter { vorbis_headerPath }
159
- end
160
- if ogg_headerPath then
161
- includedirsafter { ogg_headerPath }
162
- end
163
- if SDL2_headerPath then
164
- externalincludedirs { path .join (SDL2_headerPath , " SDL2" ) }
165
- end
166
- if SDL2_libraryPath then
167
- libdirs { SDL2_libraryPath }
168
- end
169
- links { " SDL2" , " ogg" , " vorbis" , " vorbisfile" , " vorbisenc" }
170
- filter {}
171
174
172
175
project " maxr"
173
176
kind " WindowedApp"
@@ -186,14 +189,18 @@ project "maxr"
186
189
includedirs { locationDir } -- for generated file (autoversion.h)
187
190
end
188
191
189
- files { " src/ui/**.cpp" , " src/ui/**.h" , " src/maxr.rc" }
192
+ files { " src/ui/**.cpp" , " src/ui/**.h" }
193
+ filter " system:windows"
194
+ files { " src/maxr.rc" }
195
+ filter {}
190
196
includedirs { " src" , " src/lib" }
191
197
externalincludedirs { " submodules/nlohmann/single_include" }
192
198
links { " maxr_lib" , " SDL_flic" , " mveplayer" }
193
199
linksToCrashRpt ()
194
200
195
201
debugdir " data"
196
202
203
+
197
204
project " dedicated_server"
198
205
kind " ConsoleApp"
199
206
targetdir " data"
@@ -210,7 +217,10 @@ project "dedicated_server"
210
217
includedirs { locationDir } -- for generated file (autoversion.h)
211
218
end
212
219
213
- files { " src/dedicatedserver/**.cpp" , " src/dedicated_server/**.h" , " src/maxr.rc" }
220
+ files { " src/dedicatedserver/**.cpp" , " src/dedicated_server/**.h" }
221
+ filter " system:windows"
222
+ files { " src/maxr.rc" }
223
+ filter {}
214
224
includedirs { " src" , " src/lib" }
215
225
externalincludedirs { " submodules/nlohmann/single_include" }
216
226
links { " maxr_lib" , " SDL_flic" , " mveplayer" }
0 commit comments