From 6a827871d5cc3f3119ffd6c5c78900a1c61971cd Mon Sep 17 00:00:00 2001 From: Jakub Sujak Date: Wed, 20 Mar 2024 18:18:08 +0000 Subject: =?UTF-8?q?Workaround=20to=20enable=20cross-compiling=20from=20mac?= =?UTF-8?q?OS=C2=AE=20to=20Android=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2e64b714b0da39cd39d6d498c69e81ffaa008b1e Signed-off-by: Jakub Sujak Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/11329 Tested-by: Arm Jenkins Reviewed-by: Suhail M Benchmark: Arm Jenkins --- SConscript | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SConscript b/SConscript index 4c4bcc76f9..f1b81ec2a5 100644 --- a/SConscript +++ b/SConscript @@ -30,6 +30,7 @@ import subprocess import zlib import json import codecs +import platform VERSION = "v0.0-unreleased" LIBRARY_VERSION_MAJOR = 35 @@ -41,6 +42,13 @@ Import('env') Import('vars') Import('install_lib') +# Workaround to enable cross-compiling from macOS® to Android™ using the Android NDK. +if platform.system() == 'Darwin' and env['os'] == 'android': + # SCons incorrectly assumes that we always want to build a dynamic library on a macOS host. + # When targeting Android, we overwrite the following construction variables to build a shared library instead. + env.Replace(SHLIBSUFFIX = '.so') # overwrites .dylib + env.Replace(SHLINKFLAGS = ['$LINKFLAGS', '-shared']) # overwrites -dynamiclib + def build_bootcode_objs(sources): arm_compute_env.Append(ASFLAGS = "-I bootcode/") obj = arm_compute_env.Object(sources) -- cgit v1.2.1