C++11: Update AMBuildScript

This commit is contained in:
Arkshine 2014-12-06 13:59:13 +01:00
parent 1146bcad2c
commit 1977bf4d29
3 changed files with 16 additions and 4 deletions

View File

@ -136,6 +136,7 @@ class AMXXConfig(object):
] ]
cfg.cxxflags += [ cfg.cxxflags += [
'-Wno-invalid-offsetof', '-Wno-invalid-offsetof',
'-std=c++11',
] ]
cfg.linkflags += ['-m32'] cfg.linkflags += ['-m32']
@ -143,11 +144,22 @@ class AMXXConfig(object):
have_gcc = cxx.name == 'gcc' have_gcc = cxx.name == 'gcc'
have_clang = cxx.name == 'clang' have_clang = cxx.name == 'clang'
if have_clang or (have_gcc and cxx.majorVersion >= 4): if have_clang or (have_gcc and cxx.version >= '4'):
cfg.cflags += ['-fvisibility=hidden'] cfg.cflags += ['-fvisibility=hidden']
cfg.cxxflags += ['-fvisibility-inlines-hidden'] cfg.cxxflags += ['-fvisibility-inlines-hidden']
if (have_gcc and cxx.minorVersion >= 7) or (have_clang and cxx.majorVersion >= 3): if have_clang or (have_gcc and cxx.version >= '4.6'):
cfg.cflags += ['-Wno-narrowing']
if (have_gcc and cxx.version >= '4.7') or (have_clang and cxx.version >= '3'):
cfg.cxxflags += ['-Wno-delete-non-virtual-dtor'] cfg.cxxflags += ['-Wno-delete-non-virtual-dtor']
if have_gcc and cxx.version >= '4.8':
cfg.cflags += ['-Wno-unused-result']
if have_clang:
cfg.cxxflags += ['-Wno-implicit-exception-spec-mismatch']
if cxx.version >= 'apple-clang-5.1' or cxx.version >= 'clang-3.4':
cfg.cxxflags += ['-Wno-deprecated-register']
else:
cfg.cxxflags += ['-Wno-deprecated']
cfg.cflags += ['-Wno-sometimes-uninitialized']
if have_gcc: if have_gcc:
cfg.cflags += ['-Wno-parentheses'] cfg.cflags += ['-Wno-parentheses']

View File

@ -13,10 +13,10 @@ if AMXX.mysql_path:
binary.compiler.defines += [ binary.compiler.defines += [
'SM_DEFAULT_THREADER', 'SM_DEFAULT_THREADER',
'HAVE_STDINT_H', 'HAVE_STDINT_H',
'stricmp=strcasecmp',
] ]
if builder.target_platform is 'linux' or builder.target_platform is 'mac': if builder.target_platform is 'linux' or builder.target_platform is 'mac':
binary.compiler.defines += ['stricmp=strcasecmp']
binary.compiler.linkflags += [ binary.compiler.linkflags += [
os.path.join(AMXX.mysql_path, 'lib', 'libmysqlclient_r.a'), os.path.join(AMXX.mysql_path, 'lib', 'libmysqlclient_r.a'),
'-lz', '-lz',

View File

@ -9,11 +9,11 @@ binary.compiler.cxxincludes += [
] ]
binary.compiler.defines += [ binary.compiler.defines += [
'SM_DEFAULT_THREADER', 'SM_DEFAULT_THREADER',
'stricmp=strcasecmp',
'HAVE_STDINT_H', 'HAVE_STDINT_H',
] ]
if builder.target_platform == 'linux': if builder.target_platform == 'linux':
binary.compiler.defines += ['stricmp=strcasecmp']
binary.compiler.postlink += ['-lpthread'] binary.compiler.postlink += ['-lpthread']
binary.sources += [ binary.sources += [