summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-09-01 18:16:14 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-09-01 18:17:22 +0530
commitf5ab125fa19142e0f884db4bc5c1cef268749ddf (patch)
treef824a6f5943c99aeedc1a8547592d9ccc1db7a6f /config
parentbadc9f9a2a3b85124a88c40ce9fc30f9eddcbe92 (diff)
cerbero: Fix exporting of DirectX flags while cross-building
When cross-compiling, we need to export that in CFLAGS so that the flags are added to the cross-file before building.
Diffstat (limited to 'config')
-rw-r--r--config/windows.config13
1 files changed, 8 insertions, 5 deletions
diff --git a/config/windows.config b/config/windows.config
index 56ae4932..63de11fa 100644
--- a/config/windows.config
+++ b/config/windows.config
@@ -81,11 +81,6 @@ os.environ['lt_cv_deplibs_check_method'] = 'pass_all'
os.environ['ac_cv_lib_bz2_BZ2_bzlibVersion'] = 'yes'
os.environ['ac_cv_c_attribute_aligned'] = '64'
-# With MinGW, DirectX headers are inside a subdir, and we don't want to
-# accidentally use these when building with MSVC, so we don't unconditionally
-# add them to CFLAGS.
-mingw_toolchain_env = {'CPPFLAGS': ('-I%s/%s/include/directx' % (toolchain_prefix, host), ' ')}
-
if platform == Platform.WINDOWS:
os.environ['ACLOCAL'] = 'aclocal-1.11'
# We use Visual Studio by default on Windows
@@ -109,6 +104,10 @@ if platform == Platform.WINDOWS:
os.path.join(prefix, 'include'))
msvc_toolchain_env['LIB'][0] = append_path(msvc_toolchain_env['LIB'][0],
os.path.join(prefix, 'lib' + lib_suffix))
+ # With MinGW, DirectX headers are inside a subdir, and we don't want to
+ # accidentally use these when building with MSVC, so we don't unconditionally
+ # add them to CFLAGS.
+ mingw_toolchain_env = {'CPPFLAGS': ('-I%s/%s/include/directx' % (toolchain_prefix, host), ' ')}
if export_msvc:
for var, (val, sep) in msvc_toolchain_env.items():
if var not in os.environ or not os.environ[var]:
@@ -117,3 +116,7 @@ if platform == Platform.WINDOWS:
os.environ[var] = '{}{}{}'.format(val, sep, os.environ[var])
# Don't set this twice
del os.environ['CERBERO_EXPORT_MSVC']
+else:
+ # For cross-mingw, we need to set this in the env so it's added to the
+ # cross file before Meson is run.
+ os.environ['CFLAGS'] = '-I%s/%s/include/directx' % (toolchain_prefix, host)