From d2d121619f76f32cf23e4de2f122f5af64ae13e4 Mon Sep 17 00:00:00 2001 From: Vincent Herbet Date: Sat, 8 Sep 2018 21:12:57 +0200 Subject: [PATCH] Another attempt to fix windows compilation (#556) --- AMBuildScript | 3 +++ modules/mysqlx/AMBuilder | 5 ++--- modules/regex/AMBuilder | 4 ++++ {modules/mysqlx => public/msvc}/msvc15hack.c | 0 4 files changed, 9 insertions(+), 3 deletions(-) rename {modules/mysqlx => public/msvc}/msvc15hack.c (100%) diff --git a/AMBuildScript b/AMBuildScript index 12f361ed..df3a2ab6 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -291,6 +291,9 @@ class AMXXConfig(object): 'odbccp32.lib', ] + if cxx.version >= 1900: + cxx.linkflags += ['legacy_stdio_definitions.lib', 'legacy_stdio_wide_specifiers.lib'] + if builder.options.opt == '1': cxx.cflags += ['/Ox'] cxx.linkflags += ['/OPT:ICF', '/OPT:REF'] diff --git a/modules/mysqlx/AMBuilder b/modules/mysqlx/AMBuilder index cf1e69e7..7c7bcc93 100644 --- a/modules/mysqlx/AMBuilder +++ b/modules/mysqlx/AMBuilder @@ -36,9 +36,8 @@ if AMXX.mysql_path: '/SECTION:.data,RW' ] if binary.compiler.vendor == 'msvc' and binary.compiler.version >= 1900: - binary.compiler.linkflags += ['legacy_stdio_definitions.lib', 'legacy_stdio_wide_specifiers.lib'] - binary.sources += [ - 'msvc15hack.c' + binary.sources += [ + '../../public/msvc/msvc15hack.c' ] binary.compiler.linkflags += [AMXX.zlib.binary] diff --git a/modules/regex/AMBuilder b/modules/regex/AMBuilder index 6faa6e92..16edb2d2 100644 --- a/modules/regex/AMBuilder +++ b/modules/regex/AMBuilder @@ -24,5 +24,9 @@ binary.sources = [ if builder.target_platform == 'windows': binary.sources += ['version.rc'] + if binary.compiler.vendor == 'msvc' and binary.compiler.version >= 1900: + binary.sources += [ + '../../public/msvc/msvc15hack.c' + ] AMXX.modules += [builder.Add(binary)] diff --git a/modules/mysqlx/msvc15hack.c b/public/msvc/msvc15hack.c similarity index 100% rename from modules/mysqlx/msvc15hack.c rename to public/msvc/msvc15hack.c