summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-07-12 15:09:51 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-07-12 18:42:02 +0530
commit533ef280d3a91979ed92d5891316c806235a8e9a (patch)
tree2c4819ef4cf86abd123522c2f5f11971aacd6d20 /config
parent7ce7caaa6f8e315573110f5ab796c19884d44303 (diff)
Add a uwp-universal target to build all uwp arches at once
This is identical to how the cross-android-universal target works. Supported UWP arches are: x86, x86_64, arm64. This covers 100% of Windows 10 machines: https://docs.microsoft.com/en-us/windows/msix/package/device-architecture Advantages are the same as Android: 1. Most people will build apps that target multiple (or all) archs 2. Easier to build and ship all arches at once 3. Easier to download two tarballs rather than six Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/551>
Diffstat (limited to 'config')
-rw-r--r--config/cross-uwp-universal.cbc13
-rw-r--r--config/win64.cbc1
-rw-r--r--config/windows.config29
3 files changed, 35 insertions, 8 deletions
diff --git a/config/cross-uwp-universal.cbc b/config/cross-uwp-universal.cbc
new file mode 100644
index 00000000..86363f6a
--- /dev/null
+++ b/config/cross-uwp-universal.cbc
@@ -0,0 +1,13 @@
+from cerbero.config import Platform, Architecture
+
+target_platform = Platform.WINDOWS
+variants.uwp = True
+# NOTE: This gets overridden in the arch-specific cbc files
+target_arch = Architecture.UNIVERSAL
+
+universal_archs = {
+ # Path is relative to this file
+ Architecture.ARM64: "cross-win-arm64.cbc",
+ Architecture.X86: "win32.cbc",
+ Architecture.X86_64: "win64.cbc",
+}
diff --git a/config/win64.cbc b/config/win64.cbc
index 9cd377a1..c1eb914a 100644
--- a/config/win64.cbc
+++ b/config/win64.cbc
@@ -1,3 +1,2 @@
from cerbero.config import Architecture
-arch = Architecture.X86_64
target_arch = Architecture.X86_64
diff --git a/config/windows.config b/config/windows.config
index 06d162a6..5fa09e9a 100644
--- a/config/windows.config
+++ b/config/windows.config
@@ -81,6 +81,21 @@ def cmd(command, args=None, wrapper=None):
wrapper = []
return EnvValueCmd(wrapper + ['%s%s' % (tools_prefix, command)] + args)
+# 'universal' is set by cerbero itself when building under a universal regime
+# so that we can construct different paths to include/lib directories to where
+# they actually are. Without this we don't know where the headers/libs will
+# actually end up
+if universal_archs:
+ incl_dir = os.path.join(prefix, target_arch, 'include')
+ lib_dir = os.path.join(prefix, target_arch, 'lib')
+else:
+ incl_dir = os.path.join(prefix, 'include')
+ lib_dir = os.path.join(prefix, 'lib')
+if target_arch != Architecture.UNIVERSAL and not os.path.exists(incl_dir):
+ os.makedirs(incl_dir)
+if target_arch != Architecture.UNIVERSAL and not os.path.exists(lib_dir):
+ os.makedirs(lib_dir)
+
# Default GCC compiler flags
mingw_env_for_build_system['CPPFLAGS'] = EnvValueArg(arch_flags)
mingw_env_for_build_system['CFLAGS'] = EnvValueArg(arch_flags)
@@ -110,9 +125,9 @@ if variants.uwp:
# When not cross-compiling, this is set using C{,PLUS}_INCLUDE_PATH in cerbero/config.py
if cross:
- mingw_env_for_build_system['CPPFLAGS'] += ['-I' + os.path.join(prefix, 'include')]
- mingw_env_for_build_system['CFLAGS'] += ['-I' + os.path.join(prefix, 'include')]
- mingw_env_for_build_system['CXXFLAGS'] += ['-I' + os.path.join(prefix, 'include')]
+ mingw_env_for_build_system['CPPFLAGS'] += ['-I' + incl_dir]
+ mingw_env_for_build_system['CFLAGS'] += ['-I' + incl_dir]
+ mingw_env_for_build_system['CXXFLAGS'] += ['-I' + incl_dir]
ccache = use_ccache and ['ccache'] or []
@@ -145,7 +160,7 @@ msvc_env_for_build_system['CXX'] = EnvValueCmd('cl')
msvc_env_for_build_system['AR'] = EnvValueCmd('lib')
# MinGW toolchain config env
-mingw_env_for_toolchain['LIBRARY_PATH'] = EnvValuePath(['{}/lib{}'.format(prefix, lib_suffix)])
+mingw_env_for_toolchain['LIBRARY_PATH'] = EnvValuePath([lib_dir])
# General env vars that should always be set
env['PERL'] = 'perl'
@@ -168,7 +183,7 @@ env['lt_cv_deplibs_check_method'] = 'pass_all'
env['ac_cv_lib_bz2_BZ2_bzlibVersion'] = 'yes'
env['ac_cv_c_attribute_aligned'] = '64'
-if platform == Platform.WINDOWS:
+if platform == Platform.WINDOWS and target_arch != Architecture.UNIVERSAL:
# Make's job server is buggy and broken on Windows, which causes it to
# either hang or print server errors like:
# 2068442963 [sig] make 18324 sig_dispatch_pending: Win32 error 298 releasing sigcatch_nosync(0x150)
@@ -197,8 +212,8 @@ if platform == Platform.WINDOWS:
# We want the MSVC compiler and linker to find the headers and libraries
# provided by recipes built by us, so append to INCLUDE and LIB.
# NOTE: We do not want to add the MinGW toolchain paths here
- msvc_env_for_toolchain['INCLUDE'] += [os.path.join(prefix, 'include')]
- msvc_env_for_toolchain['LIB'] += [os.path.join(prefix, 'lib' + lib_suffix)]
+ msvc_env_for_toolchain['INCLUDE'] += [incl_dir]
+ msvc_env_for_toolchain['LIB'] += [lib_dir]
msvc_env_for_toolchain['WINDRES'] = EnvValueCmd('rc')
if variants.uwp:
meson_properties['needs_exe_wrapper'] = 'true'