[Mesa-dev] [PATCH v3 13/48] meson: add windows compiler checks and libraries
Eric Anholt
eric at anholt.net
Tue Aug 7 18:16:05 UTC 2018
Dylan Baker <dylan at pnwbakers.com> writes:
> ---
> meson.build | 129 ++++++++++++++++++++++++++++++++--------------------
> 1 file changed, 79 insertions(+), 50 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 25de31bfabd..4350e1af810 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -775,69 +775,96 @@ endif
> # TODO: this is very incomplete
> if ['linux', 'cygwin'].contains(host_machine.system())
> pre_args += '-D_GNU_SOURCE'
> +elif host_machine.system() == 'windows'
> + pre_args += [
> + '-D_WINDOWS', '-D_WIN32_WINNT=0x0601', '-D_WINVER=0x0601',
> + '-DPIPE_SUBSYSTEM_WINDOWS_USER',
> + '-D_USE_MATH_DEFINES', # XXX: scons doesn't use this for mingw
> + ]
> + if cc.get_id() == 'msvc'
> + pre_args += [
> + '-DVC_EXTRALEAN',
> + '-D_CRT_SECURE_NO_WARNINGS',
> + '-D_CRT_SECURE_NO_DEPRECATE',
> + '-D_SCL_SECURE_NO_WARNINGS',
> + '-D_SCL_SECURE_NO_DEPRECATE',
> + '-D_ALLOW_KEYWORD_MACROS',
> + '-D_HAS_EXCEPTIONS=0', # Tell C++ STL to not use exceptions
> + ]
> + else
> + pre_args += ['-D__MSVCRT_VERSION__=0x0700']
> + endif
> endif
>
> # Check for generic C arguments
> c_args = []
> -foreach a : ['-Wall', '-Werror=implicit-function-declaration',
> - '-Werror=missing-prototypes', '-fno-math-errno',
> - '-fno-trapping-math', '-Qunused-arguments']
> - if cc.has_argument(a)
> - c_args += a
> - endif
> -endforeach
> -if cc.has_argument('-Wmissing-field-initializers')
> - c_args += '-Wno-missing-field-initializers'
> -endif
> -
> c_vis_args = []
> -if cc.has_argument('-fvisibility=hidden')
> - c_vis_args += '-fvisibility=hidden'
> -endif
> -
> -# Check for generic C++ arguments
> +c_msvc_compat_args = []
> +no_override_init_args = []
> cpp_args = []
> -foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math',
> - '-Qunused-arguments']
> - if cpp.has_argument(a)
> - cpp_args += a
> +cpp_vis_args = []
> +cpp_msvc_compat_args = []
> +if cc.get_id() == 'msvc'
> + foreach a : ['/wd4018', '/wd4056', '/wd4244', '/wd4246', '/wd4305',
> + '/wd4351', '/wd4756', '/wd4800', '/wd4996']
The 4246 entry doesn't match scons (4267). Could we have a list with
comments of what these do, like scons has?
I haven't reviewed the rest of the patch. It's hard to read without -b.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180807/c293cdf6/attachment.sig>
More information about the mesa-dev
mailing list