Commit 28f6c737 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜
Browse files

cerbero: Add toolchain to cache name on Windows

We need to know whether the cache is for mingw, msvc, or uwp
(debug/release).

Part-of: <!609>
parent a58b2bdb
Pipeline #204196 passed with stages
in 76 minutes and 38 seconds
......@@ -80,6 +80,13 @@ class BaseCache(Command):
distro = 'fedora'
if distro == Distro.OS_X:
distro = 'macos'
if distro == Distro.WINDOWS:
# When targeting Windows, we need to differentiate between mingw,
# msvc, and uwp (debug/release) jobs. When cross-compiling this
# will always be 'cross-windows-mingw' right now, but that might
# change at some point.
toolchain, _ = config._get_toolchain_target_platform_arch()
distro = 'windows-' + toolchain
if config.cross_compiling():
distro = 'cross-' + distro
return distro, arch
......
......@@ -703,9 +703,9 @@ class Config (object):
def _get_toolchain_target_platform_arch(self):
platform_arch = '{}_' + self.target_arch
if self.target_platform != Platform.WINDOWS or self.prefix_is_build_tools():
return platform_arch.format(self.target_platform)
return (self.target_platform, self.target_arch)
if not self.variants.visualstudio:
return platform_arch.format('mingw')
return ('mingw', self.target_arch)
# When building with Visual Studio, we can target (MSVC, UWP) x (debug, release)
if self.variants.uwp:
target_platform = 'uwp'
......@@ -717,8 +717,7 @@ class Config (object):
# Check for invalid configuration of a custom Visual Studio path
if self.vs_install_path and not self.vs_install_version:
raise ConfigurationError('vs_install_path was set, but vs_install_version was not')
return platform_arch.format(target_platform)
return (target_platform, self.target_arch)
def _load_last_defaults(self):
# Set build tools defaults
......@@ -730,7 +729,7 @@ class Config (object):
os.path.join(self.home_dir, 'logs', 'build-tools'))
self.set_property('build_tools_cache', 'build-tools.cache')
# Set target platform defaults
platform_arch = self._get_toolchain_target_platform_arch()
platform_arch = '_'.join(self._get_toolchain_target_platform_arch())
self.set_property('prefix', os.path.join(self.home_dir, "dist", platform_arch))
self.set_property('sources', os.path.join(self.home_dir, "sources", platform_arch))
self.set_property('logs', os.path.join(self.home_dir, "logs", platform_arch))
......
......@@ -513,7 +513,7 @@ class MSI(WixBase):
self.package.get_install_dir())
versiondir = self._add_dir(installdir, "Version", self.package.sdk_version)
# archdir has to be toolchain-specific: mingw_x86_64, uwp-debug_arm64, etc
platform_arch = self.config._get_toolchain_target_platform_arch()
platform_arch = '_'.join(self._get_toolchain_target_platform_arch())
archdir = self._add_dir(versiondir, 'Architecture', platform_arch)
self.installdir = self._add_dir(archdir, 'SDKROOTDIR', '.')
......@@ -553,7 +553,7 @@ class MSI(WixBase):
envcomponent = etree.SubElement(self.installdir, 'Component',
Id='EnvironmentVariables', Guid=self._get_uuid())
# archdir has to be toolchain-specific: mingw_x86_64, uwp-debug_arm64, etc
platform_arch = self.config._get_toolchain_target_platform_arch()
platform_arch = '_'.join(self._get_toolchain_target_platform_arch())
root_env_var = self.package.get_root_env_var(platform_arch)
env = etree.SubElement(envcomponent, 'Environment', Id="SdkRootEnv",
Action="set", Part="all", Name=root_env_var,
......
......@@ -18,7 +18,7 @@ class Recipe(recipe.Recipe):
import shutil
from cerbero.commands.genvsprops import GenVSProps
# archdir has to be toolchain-specific: mingw_x86_64, uwp-debug_arm64, etc
platform_arch = self.config._get_toolchain_target_platform_arch()
platform_arch = '_'.join(self.config._get_toolchain_target_platform_arch())
env_var = ('GSTREAMER_1_0_ROOT_' + platform_arch).upper()
vspropsdir = os.path.join(self.config.prefix, self.files_devel[0], 'libs')
if not os.path.exists(vspropsdir):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment