summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2024-06-22 16:22:45 +0530
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2024-07-07 12:07:54 +0000
commitcb7d26555f9d072b7f796928bda0f9a15bcc6cbe (patch)
treed0f3cb56bbe57c81d85a57e5a18741485014dda4
parent7acfa3ce425de8d1b5679116b55739c4cef1944d (diff)
cerbero: Set universal target arch prefix in config.py
The code is quite difficult to follow if we're overriding arch-specific Config values in cookbook.py Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1494>
-rw-r--r--cerbero/build/cookbook.py1
-rw-r--r--cerbero/config.py2
-rw-r--r--config/android.config16
-rw-r--r--config/ios.config5
-rw-r--r--config/windows.config16
5 files changed, 10 insertions, 30 deletions
diff --git a/cerbero/build/cookbook.py b/cerbero/build/cookbook.py
index 7ce5249a..cbfba0eb 100644
--- a/cerbero/build/cookbook.py
+++ b/cerbero/build/cookbook.py
@@ -501,7 +501,6 @@ class CookBook (object):
recipe = crecipe.UniversalRecipe(self._config)
for c in list(self._config.arch_config.keys()):
conf = self._config.arch_config[c]
- conf.prefix = os.path.join(self._config.prefix, c)
# For univeral recipes, we need to parse again the recipe file.
# Otherwise, class variables with mutable types like the "deps"
# dictionary are reused in new instances
diff --git a/cerbero/config.py b/cerbero/config.py
index 4adacfda..df0be7b1 100644
--- a/cerbero/config.py
+++ b/cerbero/config.py
@@ -396,7 +396,7 @@ class Config(object):
for config in list(self.arch_config.values()):
if self.target_arch == Architecture.UNIVERSAL:
config.sources = os.path.join(self.sources, config.target_arch)
- config.prefix = os.path.join(self.prefix)
+ config.prefix = os.path.join(self.prefix, config.target_arch)
# qmake_path is different for each arch in android-universal, but
# not in ios-universal.
qtpkgdir, qmake5 = detect_qt5(
diff --git a/config/android.config b/config/android.config
index 124786d8..895f273e 100644
--- a/config/android.config
+++ b/config/android.config
@@ -111,19 +111,11 @@ env.pop('RUSTFLAGS', None)
env['ANDROID_NDK_HOME'] = toolchain_prefix
env['ANDROID_NDK_TOOLCHAIN_BIN'] = llvm_toolchain_path
-# '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, _cerbero_arch, 'include')
- lib_dir = os.path.join(prefix, _cerbero_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):
+incl_dir = os.path.join(prefix, 'include')
+lib_dir = os.path.join(prefix, 'lib')
+if not os.path.exists(incl_dir):
os.makedirs(incl_dir)
-if target_arch != Architecture.UNIVERSAL and not os.path.exists(lib_dir):
+if not os.path.exists(lib_dir):
os.makedirs(lib_dir)
# Most of the compiler/linker specific flags are taken from
diff --git a/config/ios.config b/config/ios.config
index cddc1d43..cfb5b0a0 100644
--- a/config/ios.config
+++ b/config/ios.config
@@ -99,10 +99,7 @@ else:
raise FatalError("Arch %s not supported" % target_arch)
includedir = os.path.join(prefix, 'include')
-if universal_archs:
- lib_dir = os.path.join(prefix, target_arch, 'lib')
-else:
- lib_dir = os.path.join(prefix, 'lib')
+lib_dir = os.path.join(prefix, 'lib')
# Toolchain environment
env['CC']= 'clang'
diff --git a/config/windows.config b/config/windows.config
index e86e8c06..0ed74466 100644
--- a/config/windows.config
+++ b/config/windows.config
@@ -76,19 +76,11 @@ 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):
+incl_dir = os.path.join(prefix, 'include')
+lib_dir = os.path.join(prefix, 'lib')
+if not os.path.exists(incl_dir):
os.makedirs(incl_dir)
-if target_arch != Architecture.UNIVERSAL and not os.path.exists(lib_dir):
+if not os.path.exists(lib_dir):
os.makedirs(lib_dir)
# Default GCC compiler flags