| import os |
| import sys |
| |
| # Tell pylint that we know config and lit_config exist somewhere. |
| if 'PYLINT_IMPORT' in os.environ: |
| config = object() |
| lit_config = object() |
| |
| ndk = os.getenv('NDK') |
| if ndk is None: |
| sys.exit('The environment variable NDK must point to an NDK toolchain.') |
| |
| top = os.getenv('ANDROID_BUILD_TOP') |
| libcxx_dir = os.path.join(ndk, 'sources/cxx-stl/llvm-libc++') |
| libcxx_src_dir = os.path.join(libcxx_dir, 'libcxx') |
| |
| config.cxx_under_test = os.path.join( |
| ndk, "toolchains/llvm-3.6/prebuilt/bin/clang++") |
| config.std = "c++11" |
| config.libcxx_src_root = libcxx_src_dir |
| config.libcxx_obj_root = libcxx_src_dir |
| config.cxx_library_root = os.path.join(libcxx_dir, 'libs/arm64-v8a') |
| config.enable_exceptions = "True" |
| config.enable_rtti = "True" |
| config.enable_shared = "False" |
| config.enable_32bit = "False" |
| config.enable_threads = "True" |
| config.enable_monotonic_clock = "True" |
| config.cxx_abi = "libcxxabi" |
| config.use_sanitizer = "" |
| config.configuration_variant = "libcxx.ndk" |
| config.target_triple = "aarch64-linux-android" |
| config.sysroot = os.path.join(ndk, "platforms/android-21/arch-arm64/") |
| config.gcc_toolchain = os.path.join( |
| ndk, "toolchains/aarch64-linux-android-4.9") |
| |
| # Let the main config do the real work. |
| lit_config.load_config( |
| config, os.path.join(libcxx_src_dir, "test/lit.cfg")) |