summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTim Van Patten <timvp@google.com>2019-01-11 11:42:16 -0700
committerAlexander Galazin <Alexander.Galazin@arm.com>2019-02-21 02:59:15 -0500
commitb6b732f7858925bf2e8b14475d03cae4a72208ea (patch)
tree54176823b1029b18cc514141bff65c2099a7ec77 /scripts
parentb7efacd7b320d2b2c3b8b75cf98c9979b5a29fe9 (diff)
downloadVK-GL-CTS-b6b732f7858925bf2e8b14475d03cae4a72208ea.tar.gz
VK-GL-CTS-b6b732f7858925bf2e8b14475d03cae4a72208ea.tar.bz2
VK-GL-CTS-b6b732f7858925bf2e8b14475d03cae4a72208ea.zip
Fix Android dEQP builds when linking against and embedding ANGLE
The Android dEQP build is failing to link against ANGLE when using the option '--angle-path'. This fix correctly clears the necessary CMAKE variables so the find_library() call will search for the ANGLE libraries during an Android build. Components: Android dEQP Google bug: 80239516 Change-Id: I9ceb82e47becda56ff7ace77f999f37c70dd97b0
Diffstat (limited to 'scripts')
-rw-r--r--scripts/android/build_apk.py28
1 files changed, 26 insertions, 2 deletions
diff --git a/scripts/android/build_apk.py b/scripts/android/build_apk.py
index b402b5d7e..0504330ce 100644
--- a/scripts/android/build_apk.py
+++ b/scripts/android/build_apk.py
@@ -326,6 +326,13 @@ class BuildStep:
def getNativeBuildPath (config, abiName):
return os.path.join(config.buildPath, "%s-%s-%d" % (abiName, config.nativeBuildType, config.nativeApi))
+def clearCMakeCacheVariables(args):
+ # New value, so clear the necessary cmake variables
+ args.append('-UANGLE_LIBS')
+ args.append('-UGLES1_LIBRARY')
+ args.append('-UGLES2_LIBRARY')
+ args.append('-UEGL_LIBRARY')
+
def buildNativeLibrary (config, abiName):
def makeNDKVersionString (version):
minorVersionString = (chr(ord('a') + version[1]) if version[1] > 0 else "")
@@ -342,8 +349,25 @@ def buildNativeLibrary (config, abiName):
'-DDE_ANDROID_API=%s' % config.nativeApi,
'-DGLCTS_GTF_TARGET=%s' % config.gtfTarget]
- if config.angle is not None:
- args.append('-DANGLE_LIBS=%s' % os.path.join(config.angle, abiName))
+ if config.angle is None:
+ # Find any previous builds that may have embedded ANGLE libs and clear the CMake cache
+ for abi in NDKEnv.getKnownAbis():
+ cMakeCachePath = os.path.join(getNativeBuildPath(config, abi), "CMakeCache.txt")
+ try:
+ if 'ANGLE_LIBS' in open(cMakeCachePath).read():
+ clearCMakeCacheVariables(args)
+ except IOError:
+ pass
+ else:
+ cMakeCachePath = os.path.join(getNativeBuildPath(config, abiName), "CMakeCache.txt")
+ angleLibsDir = os.path.join(config.angle, abiName)
+ # Check if the user changed where the ANGLE libs are being loaded from
+ try:
+ if angleLibsDir not in open(cMakeCachePath).read():
+ clearCMakeCacheVariables(args)
+ except IOError:
+ pass
+ args.append('-DANGLE_LIBS=%s' % angleLibsDir)
return args