summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-03-04 04:02:55 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-03-04 19:58:57 +0530
commitf5da196fb311b7253b91b1c78fa6b0b7d7ec2a9a (patch)
treef2114008af164c44d9fb5d8da1d3e9053e610bbc /config
parent2422ff72b4c08fa36e178cca12862633d54e5751 (diff)
cerbero/windows: Don't try to use objc/objc++ compilers
Meson 0.53 can correctly detect MinGW objc/objc++ compilers, which means that if you follow our instructions and install MSYS/MinGW, you will have those available, which will be found by Meson. This has the unintended side-effect that Meson will then use the objc++ compiler to find libraries that it's searching for in `dependency()` calls, since it has higher priority than the C++ compiler (which is MSVC++ in our case). So Meson will end up preferring `libfoo.dll.a` over `foo.lib` when looking for import libraries. Unfortunately, some of those are malformed (such as `libssl.dll.a` and `libcrypto.dll.a`) and the DLLs will fail to load some symbols at runtime, such as `DTLS_method`. Fixes https://gitlab.freedesktop.org/gstreamer/cerbero/issues/246 To fix the duplication in the outer env and in the MSVC env, we will need to completely switch over to using `mingw_toolchain_env` for the MinGW/GCC environment so that we don't need to wipe the outer env when building MSVC recipes.
Diffstat (limited to 'config')
-rw-r--r--config/windows.config7
1 files changed, 7 insertions, 0 deletions
diff --git a/config/windows.config b/config/windows.config
index 87b740a3..e1c76819 100644
--- a/config/windows.config
+++ b/config/windows.config
@@ -84,6 +84,9 @@ env['PERL'] = 'perl'
env['GENDEF'] = 'gendef'
env['NM'] = cmd('nm')
env['DLLTOOL'] = cmd('dlltool', dlltool_flags)
+# Ensure that we never accidentally use MSYS/MinGW objc/c++ compilers
+env['OBJC'] = 'false'
+env['OBJCXX'] = 'false'
if not for_shell or 'novisualstudio' in variants:
env['LIBRARY_PATH'] = "{0}/lib{1}".format(prefix, lib_suffix)
env['CC'] = cmd('gcc', arch_flags, ccache)
@@ -144,6 +147,10 @@ if platform == Platform.WINDOWS:
# Auto detected (by msvc) code page might cause compile error depending on locale
# https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8
msvc_toolchain_env['CFLAGS'] = ['/utf-8', ' ']
+ # Ensure that we don't accidentally use the MSYS/MinGW objc/c++ compilers
+ # for anything when building with MSVC
+ msvc_toolchain_env['OBJC'] = ['false', '']
+ msvc_toolchain_env['OBJCXX'] = ['false', '']
# Export the env for an MSVC shell
if for_shell and 'novisualstudio' not in variants: