From 1977bf4d29ae48a4c7c8a23e7315794cc0042b46 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sat, 6 Dec 2014 13:59:13 +0100 Subject: [PATCH] C++11: Update AMBuildScript --- AMBuildScript | 16 ++++++++++++++-- dlls/mysqlx/AMBuilder | 2 +- dlls/sqlite/AMBuilder | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/AMBuildScript b/AMBuildScript index 7b88dbdf..b4fbe0c6 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -136,6 +136,7 @@ class AMXXConfig(object): ] cfg.cxxflags += [ '-Wno-invalid-offsetof', + '-std=c++11', ] cfg.linkflags += ['-m32'] @@ -143,11 +144,22 @@ class AMXXConfig(object): have_gcc = cxx.name == 'gcc' 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.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'] + 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: cfg.cflags += ['-Wno-parentheses'] diff --git a/dlls/mysqlx/AMBuilder b/dlls/mysqlx/AMBuilder index a8524830..8049995d 100644 --- a/dlls/mysqlx/AMBuilder +++ b/dlls/mysqlx/AMBuilder @@ -13,10 +13,10 @@ if AMXX.mysql_path: binary.compiler.defines += [ 'SM_DEFAULT_THREADER', 'HAVE_STDINT_H', - 'stricmp=strcasecmp', ] if builder.target_platform is 'linux' or builder.target_platform is 'mac': + binary.compiler.defines += ['stricmp=strcasecmp'] binary.compiler.linkflags += [ os.path.join(AMXX.mysql_path, 'lib', 'libmysqlclient_r.a'), '-lz', diff --git a/dlls/sqlite/AMBuilder b/dlls/sqlite/AMBuilder index 2c29b612..078f6428 100644 --- a/dlls/sqlite/AMBuilder +++ b/dlls/sqlite/AMBuilder @@ -9,11 +9,11 @@ binary.compiler.cxxincludes += [ ] binary.compiler.defines += [ 'SM_DEFAULT_THREADER', - 'stricmp=strcasecmp', 'HAVE_STDINT_H', ] if builder.target_platform == 'linux': + binary.compiler.defines += ['stricmp=strcasecmp'] binary.compiler.postlink += ['-lpthread'] binary.sources += [