This class is used to get the current NDK information.
| 3 | |
| 4 | |
| 5 | class AndroidNDK: |
| 6 | """ |
| 7 | This class is used to get the current NDK information. |
| 8 | """ |
| 9 | |
| 10 | ndk_dir = "" |
| 11 | |
| 12 | def __init__(self, ndk_dir): |
| 13 | self.ndk_dir = ndk_dir |
| 14 | |
| 15 | @property |
| 16 | def host_tag(self): |
| 17 | """ |
| 18 | Returns the host tag for the current system. |
| 19 | Note: The host tag is ``darwin-x86_64`` even on Apple Silicon macs. |
| 20 | """ |
| 21 | return f"{sys.platform}-x86_64" |
| 22 | |
| 23 | @property |
| 24 | def llvm_prebuilt_dir(self): |
| 25 | return os.path.join( |
| 26 | self.ndk_dir, "toolchains", "llvm", "prebuilt", self.host_tag |
| 27 | ) |
| 28 | |
| 29 | @property |
| 30 | def llvm_bin_dir(self): |
| 31 | return os.path.join(self.llvm_prebuilt_dir, "bin") |
| 32 | |
| 33 | @property |
| 34 | def clang(self): |
| 35 | return os.path.join(self.llvm_bin_dir, "clang") |
| 36 | |
| 37 | @property |
| 38 | def clang_cxx(self): |
| 39 | return os.path.join(self.llvm_bin_dir, "clang++") |
| 40 | |
| 41 | @property |
| 42 | def llvm_binutils_prefix(self): |
| 43 | return os.path.join(self.llvm_bin_dir, "llvm-") |
| 44 | |
| 45 | @property |
| 46 | def llvm_ar(self): |
| 47 | return f"{self.llvm_binutils_prefix}ar" |
| 48 | |
| 49 | @property |
| 50 | def llvm_ranlib(self): |
| 51 | return f"{self.llvm_binutils_prefix}ranlib" |
| 52 | |
| 53 | @property |
| 54 | def llvm_objcopy(self): |
| 55 | return f"{self.llvm_binutils_prefix}objcopy" |
| 56 | |
| 57 | @property |
| 58 | def llvm_objdump(self): |
| 59 | return f"{self.llvm_binutils_prefix}objdump" |
| 60 | |
| 61 | @property |
| 62 | def llvm_readelf(self): |