Fixed whitespace (wtf python?)
This commit is contained in:
parent
93dd6d47aa
commit
576529e60c
@ -12,17 +12,17 @@ class SM:
|
|||||||
|
|
||||||
#Build SDK info
|
#Build SDK info
|
||||||
self.sdkInfo = { }
|
self.sdkInfo = { }
|
||||||
self.sdkInfo['ep2v'] = {'sdk': 'HL2SDKOBVALVE', 'ext': '2.ep2v', 'def': '4',
|
self.sdkInfo['ep2v'] = {'sdk': 'HL2SDKOBVALVE', 'ext': '2.ep2v', 'def': '4',
|
||||||
'name': 'ORANGEBOXVALVE', 'platform': ['windows', 'linux', 'darwin']}
|
'name': 'ORANGEBOXVALVE', 'platform': ['windows', 'linux', 'darwin']}
|
||||||
|
|
||||||
if AMBuild.mode == 'config':
|
if AMBuild.mode == 'config':
|
||||||
#Detect compilers
|
#Detect compilers
|
||||||
self.compiler.DetectAll(AMBuild)
|
self.compiler.DetectAll(AMBuild)
|
||||||
|
|
||||||
#Detect variables
|
#Detect variables
|
||||||
envvars = { 'MMSOURCE18': 'mmsource-1.8',
|
envvars = { 'MMSOURCE18': 'mmsource-1.8',
|
||||||
'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
|
'HL2SDKOBVALVE': 'hl2sdk-ob-valve',
|
||||||
'SOURCEMOD14': 'sourcemod-1.4'
|
'SOURCEMOD14': 'sourcemod-1.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
#Must have a path for each envvar (file a bug if you don't like this)
|
#Must have a path for each envvar (file a bug if you don't like this)
|
||||||
@ -47,10 +47,10 @@ class SM:
|
|||||||
#Set up defines
|
#Set up defines
|
||||||
cxx = self.compiler.cxx
|
cxx = self.compiler.cxx
|
||||||
if isinstance(cxx, Cpp.CompatGCC):
|
if isinstance(cxx, Cpp.CompatGCC):
|
||||||
if isinstance(cxx, Cpp.GCC):
|
if isinstance(cxx, Cpp.GCC):
|
||||||
self.vendor = 'gcc'
|
self.vendor = 'gcc'
|
||||||
elif isinstance(cxx, Cpp.Clang):
|
elif isinstance(cxx, Cpp.Clang):
|
||||||
self.vendor = 'clang'
|
self.vendor = 'clang'
|
||||||
self.compiler.AddToListVar('CDEFINES', 'stricmp=strcasecmp')
|
self.compiler.AddToListVar('CDEFINES', 'stricmp=strcasecmp')
|
||||||
self.compiler.AddToListVar('CDEFINES', '_stricmp=strcasecmp')
|
self.compiler.AddToListVar('CDEFINES', '_stricmp=strcasecmp')
|
||||||
self.compiler.AddToListVar('CDEFINES', '_snprintf=snprintf')
|
self.compiler.AddToListVar('CDEFINES', '_snprintf=snprintf')
|
||||||
@ -75,13 +75,13 @@ class SM:
|
|||||||
self.compiler.AddToListVar('CXXFLAGS', '-fno-threadsafe-statics')
|
self.compiler.AddToListVar('CXXFLAGS', '-fno-threadsafe-statics')
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-Wno-non-virtual-dtor')
|
self.compiler.AddToListVar('CXXFLAGS', '-Wno-non-virtual-dtor')
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-Wno-overloaded-virtual')
|
self.compiler.AddToListVar('CXXFLAGS', '-Wno-overloaded-virtual')
|
||||||
if (self.vendor == 'gcc' and cxx.majorVersion >= 4 and cxx.minorVersion >= 7) or \
|
if (self.vendor == 'gcc' and cxx.majorVersion >= 4 and cxx.minorVersion >= 7) or \
|
||||||
(self.vendor == 'clang' and cxx.majorVersion >= 3):
|
(self.vendor == 'clang' and cxx.majorVersion >= 3):
|
||||||
self.compiler.AddToListVar('CXXFLAGS', '-Wno-delete-non-virtual-dtor')
|
self.compiler.AddToListVar('CXXFLAGS', '-Wno-delete-non-virtual-dtor')
|
||||||
self.compiler.AddToListVar('CDEFINES', 'HAVE_STDINT_H')
|
self.compiler.AddToListVar('CDEFINES', 'HAVE_STDINT_H')
|
||||||
self.compiler.AddToListVar('CDEFINES', 'GNUC')
|
self.compiler.AddToListVar('CDEFINES', 'GNUC')
|
||||||
if self.vendor == 'gcc':
|
if self.vendor == 'gcc':
|
||||||
self.compiler.AddToListVar('CFLAGS', '-mfpmath=sse')
|
self.compiler.AddToListVar('CFLAGS', '-mfpmath=sse')
|
||||||
elif isinstance(cxx, Cpp.MSVC):
|
elif isinstance(cxx, Cpp.MSVC):
|
||||||
self.vendor = 'msvc'
|
self.vendor = 'msvc'
|
||||||
if AMBuild.options.debug == '1':
|
if AMBuild.options.debug == '1':
|
||||||
@ -136,37 +136,36 @@ class SM:
|
|||||||
|
|
||||||
#Platform-specifics
|
#Platform-specifics
|
||||||
if AMBuild.target['platform'] == 'linux':
|
if AMBuild.target['platform'] == 'linux':
|
||||||
self.compiler.AddToListVar('CDEFINES', '_LINUX')
|
self.compiler.AddToListVar('CDEFINES', '_LINUX')
|
||||||
if self.vendor == 'gcc':
|
if self.vendor == 'gcc':
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-static-libgcc')
|
self.compiler.AddToListVar('POSTLINKFLAGS', '-static-libgcc')
|
||||||
if self.vendor == 'clang':
|
if self.vendor == 'clang':
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-lgcc_eh')
|
self.compiler.AddToListVar('POSTLINKFLAGS', '-lgcc_eh')
|
||||||
elif AMBuild.target['platform'] == 'darwin':
|
elif AMBuild.target['platform'] == 'darwin':
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-mmacosx-version-min=10.5')
|
self.compiler.AddToListVar('POSTLINKFLAGS', '-mmacosx-version-min=10.5')
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', ['-arch', 'i386'])
|
self.compiler.AddToListVar('POSTLINKFLAGS', ['-arch', 'i386'])
|
||||||
self.compiler.AddToListVar('POSTLINKFLAGS', '-lstdc++')
|
self.compiler.AddToListVar('POSTLINKFLAGS', '-lstdc++')
|
||||||
|
|
||||||
# For OS X dylib versioning
|
# For OS X dylib versioning
|
||||||
import re
|
import re
|
||||||
productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r')
|
productFile = open(os.path.join(AMBuild.sourceFolder, 'product.version'), 'r')
|
||||||
productContents = productFile.read()
|
productContents = productFile.read()
|
||||||
productFile.close()
|
productFile.close()
|
||||||
m = re.match('(\d+)\.(\d+)\.(\d+).*', productContents)
|
m = re.match('(\d+)\.(\d+)\.(\d+).*', productContents)
|
||||||
if m == None:
|
if m == None:
|
||||||
self.version = '1.0.0'
|
self.version = '1.0.0'
|
||||||
else:
|
else:
|
||||||
major, minor, release = m.groups()
|
major, minor, release = m.groups()
|
||||||
self.version = '{0}.{1}.{2}'.format(major, minor, release)
|
self.version = '{0}.{1}.{2}'.format(major, minor, release)
|
||||||
AMBuild.cache.CacheVariable('version', self.version)
|
AMBuild.cache.CacheVariable('version', self.version)
|
||||||
elif AMBuild.target['platform'] == 'windows':
|
elif AMBuild.target['platform'] == 'windows':
|
||||||
self.compiler.AddToListVar('CDEFINES', 'WIN32')
|
self.compiler.AddToListVar('CDEFINES', 'WIN32')
|
||||||
self.compiler.AddToListVar('CDEFINES', '_WINDOWS')
|
self.compiler.AddToListVar('CDEFINES', '_WINDOWS')
|
||||||
|
|
||||||
#Finish up
|
#Finish up
|
||||||
self.compiler.AddToListVar('CDEFINES', 'SOURCEMOD_BUILD')
|
self.compiler.AddToListVar('CDEFINES', 'SOURCEMOD_BUILD')
|
||||||
self.compiler.AddToListVar('CDEFINES', 'SM_GENERATED_BUILD')
|
self.compiler.AddToListVar('CDEFINES', 'SM_GENERATED_BUILD')
|
||||||
self.compiler.AddToListVar('CINCLUDES',
|
self.compiler.AddToListVar('CINCLUDES', os.path.join(AMBuild.outputFolder, 'includes'))
|
||||||
os.path.join(AMBuild.outputFolder, 'includes'))
|
|
||||||
self.compiler.ToConfig(AMBuild, 'compiler')
|
self.compiler.ToConfig(AMBuild, 'compiler')
|
||||||
AMBuild.cache.CacheVariable('vendor', self.vendor)
|
AMBuild.cache.CacheVariable('vendor', self.vendor)
|
||||||
self.targetMap = { }
|
self.targetMap = { }
|
||||||
@ -177,7 +176,7 @@ class SM:
|
|||||||
|
|
||||||
if AMBuild.target['platform'] == 'windows':
|
if AMBuild.target['platform'] == 'windows':
|
||||||
self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'extension'))
|
self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'extension'))
|
||||||
|
|
||||||
self.mmsPath = AMBuild.cache['MMSOURCE18']
|
self.mmsPath = AMBuild.cache['MMSOURCE18']
|
||||||
|
|
||||||
def DefaultCompiler(self):
|
def DefaultCompiler(self):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user