Added --no-mysql option to configure script to make MySQL optional (bug 5661, r+a=dvander).
This commit is contained in:
parent
64be2bc5a0
commit
d3d5cd8181
@ -51,12 +51,17 @@ class SM:
|
|||||||
if AMBuild.mode == 'config':
|
if AMBuild.mode == 'config':
|
||||||
#Detect compilers
|
#Detect compilers
|
||||||
self.compiler.DetectAll(AMBuild)
|
self.compiler.DetectAll(AMBuild)
|
||||||
|
|
||||||
#Required paths
|
self.hasMySql = AMBuild.options.hasMySql
|
||||||
|
AMBuild.cache.CacheVariable('hasMySql', self.hasMySql)
|
||||||
|
|
||||||
|
#Environment variable paths to external headers
|
||||||
envvars = { 'MMSOURCE19': 'mmsource-1.9', 'MYSQL5': 'mysql-5.0' }
|
envvars = { 'MMSOURCE19': 'mmsource-1.9', 'MYSQL5': 'mysql-5.0' }
|
||||||
|
|
||||||
#Look for Metamod:Source and MySQL directories
|
#Look for Metamod:Source and MySQL if not disabled
|
||||||
for env in envvars:
|
for env in envvars:
|
||||||
|
if not self.hasMySql and env == 'MYSQL5':
|
||||||
|
continue
|
||||||
path = self.ResolveEnvPath(env, envvars[env])
|
path = self.ResolveEnvPath(env, envvars[env])
|
||||||
if path == None:
|
if path == None:
|
||||||
raise Exception('Could not find a valid path for {0}'.format(env))
|
raise Exception('Could not find a valid path for {0}'.format(env))
|
||||||
@ -220,6 +225,7 @@ class SM:
|
|||||||
self.sdkInfo = AMBuild.cache['sdkInfo']
|
self.sdkInfo = AMBuild.cache['sdkInfo']
|
||||||
self.compiler.FromConfig(AMBuild, 'compiler')
|
self.compiler.FromConfig(AMBuild, 'compiler')
|
||||||
self.targetMap = AMBuild.cache['targetMap']
|
self.targetMap = AMBuild.cache['targetMap']
|
||||||
|
self.hasMySql = AMBuild.cache['hasMySql']
|
||||||
|
|
||||||
if AMBuild.target['platform'] == 'windows':
|
if AMBuild.target['platform'] == 'windows':
|
||||||
self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public'))
|
self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public'))
|
||||||
@ -441,6 +447,9 @@ FileList = [
|
|||||||
['tools', 'buildbot', 'BreakpadSymbols']
|
['tools', 'buildbot', 'BreakpadSymbols']
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if not sm.hasMySql:
|
||||||
|
FileList.remove(['extensions', 'mysql', 'AMBuilder'])
|
||||||
|
|
||||||
for parts in FileList:
|
for parts in FileList:
|
||||||
AMBuild.Include(os.path.join(*parts), globals)
|
AMBuild.Include(os.path.join(*parts), globals)
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ run.options.add_option('--enable-debug', action='store_const', const='1', dest='
|
|||||||
help='Enable debugging symbols')
|
help='Enable debugging symbols')
|
||||||
run.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt',
|
run.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt',
|
||||||
help='Enable optimization')
|
help='Enable optimization')
|
||||||
|
run.options.add_option('--no-mysql', action='store_false', default=True, dest='hasMySql',
|
||||||
|
help='Disable building MySQL extension')
|
||||||
run.options.add_option('-s', '--sdks', default='all', dest='sdks',
|
run.options.add_option('-s', '--sdks', default='all', dest='sdks',
|
||||||
help='Build against specified SDKs; valid args are "all", "present", or '
|
help='Build against specified SDKs; valid args are "all", "present", or '
|
||||||
'comma-delimited list of engine names (default: %default)')
|
'comma-delimited list of engine names (default: %default)')
|
||||||
|
@ -230,7 +230,8 @@ AddHL2Library('sourcemod', 'bin')
|
|||||||
AddNormalLibrary('sourcemod.logic', 'bin')
|
AddNormalLibrary('sourcemod.logic', 'bin')
|
||||||
AddNormalLibrary('sourcepawn.jit.x86', 'bin')
|
AddNormalLibrary('sourcepawn.jit.x86', 'bin')
|
||||||
AddNormalLibrary('geoip.ext', 'extensions')
|
AddNormalLibrary('geoip.ext', 'extensions')
|
||||||
AddNormalLibrary('dbi.mysql.ext', 'extensions')
|
if SM.hasMySql:
|
||||||
|
AddNormalLibrary('dbi.mysql.ext', 'extensions')
|
||||||
AddNormalLibrary('dbi.sqlite.ext', 'extensions')
|
AddNormalLibrary('dbi.sqlite.ext', 'extensions')
|
||||||
|
|
||||||
if 'css' in SM.sdkInfo:
|
if 'css' in SM.sdkInfo:
|
||||||
|
Loading…
Reference in New Issue
Block a user