build: add some defines for MSVC to allow it to be unixy
authorAdrian Perez de Castro <aperez@igalia.com>
Mon, 5 Aug 2019 10:37:23 +0000 (13:37 +0300)
committerRan Benita <ran234@gmail.com>
Sat, 28 Dec 2019 14:12:15 +0000 (16:12 +0200)
[ran: combined some commits]

meson.build

index 0098492..d8b9430 100644 (file)
@@ -114,6 +114,14 @@ elif cc.has_header_symbol('stdlib.h', '__secure_getenv', prefix: system_ext_defi
 else
     message('C library does not support secure_getenv, using getenv instead')
 endif
+# Silence some security & deprecation warnings on MSVC
+# for some unix/C functions we use.
+# https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=vs-2019
+configh_data.set('_CRT_SECURE_NO_WARNINGS', 1)
+configh_data.set('_CRT_NONSTDC_NO_WARNINGS', 1)
+configh_data.set('_CRT_NONSTDC_NO_DEPRECATE', 1)
+# Reduce unnecessary includes on MSVC.
+configh_data.set('WIN32_LEAN_AND_MEAN', 1)
 configure_file(output: 'config.h', configuration: configh_data)