Skip to content

Commit

Permalink
(conan-io#4253) [android-ndk] ANDROID_NDK_ROOT environment var should…
Browse files Browse the repository at this point in the history
… be preset

+ expose ANDROID_NDK_ROOT/ANDROID_NDK_HOME variables to virtualenv generator
https://docs.conan.io/en/latest/mastering/virtualenv.html#virtualenv-generator
  • Loading branch information
dmn-star authored Jan 21, 2021
1 parent 1f521e3 commit c60b775
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions recipes/android-ndk/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,16 @@ def package_info(self):
# ndk-build: https://developer.android.com/ndk/guides/ndk-build
self.env_info.PATH.append(self.package_folder)

# this is not enough, I can kill that .....
# You should use the ANDROID_NDK_ROOT environment variable to indicate where the NDK is located.
# That's what most NDK-related scripts use (inside the NDK, and outside of it).
# https://groups.google.com/g/android-ndk/c/qZjhOaynHXc
self.output.info('Creating ANDROID_NDK_ROOT environment variable: %s' % self.package_folder)
self.env_info.ANDROID_NDK_ROOT = self.package_folder

self.output.info('Creating ANDROID_NDK_HOME environment variable: %s' % self.package_folder)
self.env_info.ANDROID_NDK_HOME = self.package_folder

# this is not enough, I can kill that .....
if not hasattr(self, 'settings_target'):
return

Expand All @@ -156,9 +165,6 @@ def package_info(self):
self.output.info('Creating NDK_ROOT environment variable: %s' % self._ndk_root)
self.env_info.NDK_ROOT = self._ndk_root

self.output.info('Creating ANDROID_NDK_HOME environment variable: %s' % self.package_folder)
self.env_info.ANDROID_NDK_HOME = self.package_folder

self.output.info('Creating CHOST environment variable: %s' % self._llvm_triplet)
self.env_info.CHOST = self._llvm_triplet

Expand Down

0 comments on commit c60b775

Please sign in to comment.