@@ -256,6 +256,7 @@ class MMSConfig(object):
256
256
cxx .linkflags += ['-static-libgcc' ]
257
257
elif cxx .family == 'clang' :
258
258
cxx .linkflags += ['-lgcc_eh' ]
259
+ cxx .linkflags += ['-static-libstdc++' ]
259
260
elif cxx .target .platform == 'mac' :
260
261
cxx .defines += ['OSX' , '_OSX' , 'POSIX' ]
261
262
@@ -271,8 +272,10 @@ class MMSConfig(object):
271
272
]
272
273
273
274
cxx .linkflags += [
275
+ '-stdlib=libc++' ,
274
276
'-lc++' ,
275
277
]
278
+ cxx .cxxflags += ['-stdlib=libc++' ]
276
279
elif cxx .target .platform == 'windows' :
277
280
cxx .defines += ['WIN32' , '_WINDOWS' ]
278
281
@@ -289,54 +292,6 @@ class MMSConfig(object):
289
292
os .path .join (builder .sourcePath , 'versionlib' ),
290
293
]
291
294
292
- def HL2Compiler (self , context , cxx , sdk ):
293
- compiler = cxx .clone ()
294
- compiler .cxxincludes += [
295
- os .path .join (context .currentSourcePath ),
296
- os .path .join (context .currentSourcePath , 'sourcehook' ),
297
- os .path .join (context .sourcePath , 'loader' ),
298
- ]
299
-
300
- defines = []
301
- for other_sdk in self .sdk_manifests :
302
- defines += ['SE_{}={}' .format (other_sdk ['define' ], other_sdk ['code' ])]
303
-
304
- compiler .defines += defines
305
- compiler .defines += ['SOURCE_ENGINE={}' .format (sdk ['code' ])]
306
-
307
- if sdk ['name' ] in ['sdk2013' , 'bms' , 'pvkii' ] and compiler .like ('gcc' ):
308
- # The 2013 SDK already has these in public/tier0/basetypes.h
309
- compiler .defines .remove ('stricmp=strcasecmp' )
310
- compiler .defines .remove ('_stricmp=strcasecmp' )
311
- compiler .defines .remove ('_snprintf=snprintf' )
312
- compiler .defines .remove ('_vsnprintf=vsnprintf' )
313
-
314
- if compiler .family == 'msvc' :
315
- compiler .defines += ['COMPILER_MSVC' ]
316
- if compiler .target .arch == 'x86' :
317
- compiler .defines += ['COMPILER_MSVC32' ]
318
- elif compiler .target .arch == 'x86_64' :
319
- compiler .defines += ['COMPILER_MSVC64' ]
320
-
321
- if compiler .version >= 1900 :
322
- compiler .linkflags += ['legacy_stdio_definitions.lib' ]
323
- else :
324
- compiler .defines += ['COMPILER_GCC' ]
325
-
326
- if compiler .target .arch == 'x86_64' :
327
- compiler .defines += ['X64BITS' , 'PLATFORM_64BITS' ]
328
-
329
- SdkHelpers .addLists (sdk , 'defines' , compiler )
330
- SdkHelpers .addLists (sdk , 'linkflags' , compiler )
331
-
332
- if sdk ['name' ] in ['dota' , 'cs2' ]:
333
- compiler .defines += ['META_IS_SOURCE2' ]
334
-
335
- for path in sdk ['include_paths' ]:
336
- compiler .cxxincludes += [os .path .join (sdk ['path' ], path )]
337
-
338
- return compiler
339
-
340
295
def AddVersioning (self , binary ):
341
296
if binary .compiler .target .platform == 'windows' :
342
297
binary .sources += ['version.rc' ]
@@ -378,33 +333,23 @@ class MMSConfig(object):
378
333
return cxx .StaticLibrary (name )
379
334
380
335
def HL2Library (self , context , compiler , name , sdk ):
381
- compiler = self .HL2Compiler (context , compiler , sdk )
382
-
383
- lib_folder = sdk [compiler .target .platform ][compiler .target .arch ]['lib_folder' ]
384
- lib_folder = os .path .join (sdk ['path' ], lib_folder )
385
- for lib in SdkHelpers .getLists (sdk , 'libs' , compiler ):
386
- compiler .linkflags += [os .path .join (sdk ['path' ], lib_folder , lib )]
387
- for lib in SdkHelpers .getLists (sdk , 'postlink_libs' , compiler ):
388
- compiler .postlink += [os .path .join (sdk ['path' ], lib_folder , lib )]
389
-
390
336
binary = self .Library (compiler , name )
391
- compiler = binary .compiler
337
+ cxx = binary .compiler
392
338
393
- if compiler .target .platform == 'linux' :
394
- compiler .linkflags [0 :0 ] = ['-lm' ]
395
- elif compiler .target .platform == 'mac' :
396
- binary .compiler .linkflags .append ('-liconv' )
339
+ cxx .cxxincludes += [
340
+ os .path .join (context .currentSourcePath ),
341
+ os .path .join (context .currentSourcePath , 'sourcehook' ),
342
+ os .path .join (context .sourcePath , 'loader' ),
343
+ ]
397
344
398
- dynamic_libs = SdkHelpers .getLists (sdk , 'dynamic_libs' , compiler )
399
- for library in dynamic_libs :
400
- source_path = os .path .join (lib_folder , library )
401
- output_path = os .path .join (binary .localFolder , library )
345
+ defines = []
346
+ for other_sdk in self .sdk_manifests :
347
+ cxx .defines += ['SE_{}={}' .format (other_sdk ['define' ], other_sdk ['code' ])]
402
348
403
- context . AddFolder ( binary . localFolder )
404
- output = context . AddSymlink ( source_path , output_path )
349
+ if sdk [ 'source2' ]:
350
+ cxx . defines += [ 'META_IS_SOURCE2' ]
405
351
406
- binary .compiler .weaklinkdeps += [output ]
407
- binary .compiler .linkflags [0 :0 ] = [library ]
352
+ SdkHelpers .configureCxx (context , binary , sdk )
408
353
409
354
return binary
410
355
0 commit comments