1 import os 2 import sys 3 4 # Tell pylint that we know config and lit_config exist somewhere. 5 if 'PYLINT_IMPORT' in os.environ: 6 config = object() 7 lit_config = object() 8 9 ndk = os.getenv('NDK') 10 if ndk is None: 11 sys.exit('The environment variable NDK must point to an NDK toolchain.') 12 13 top = os.getenv('ANDROID_BUILD_TOP') 14 out_dir = os.getenv('ANDROID_PRODUCT_OUT') 15 16 if top is None or out_dir is None: 17 sys.exit('ANDROID_BUILD_TOP or ANDROID_PRODUCT_OUT is not set. Have you ' 18 'run lunch?') 19 20 config.cxx_under_test = os.path.join( 21 top, "prebuilts/clang/linux-x86/host/3.6/bin/clang++") 22 config.std = "c++11" 23 config.libcxx_src_root = os.path.join(top, "external/libcxx") 24 config.libcxx_obj_root = os.path.join(top, "external/libcxx") 25 config.cxx_library_root = os.path.join(out_dir, 'system/lib') 26 config.enable_exceptions = "True" 27 config.enable_rtti = "True" 28 config.enable_shared = "False" 29 config.enable_32bit = "False" 30 config.enable_threads = "True" 31 config.enable_monotonic_clock = "True" 32 config.cxx_abi = "libcxxabi" 33 config.use_sanitizer = "" 34 config.configuration_variant = "libcxx.ndk" 35 config.target_triple = "armv7a-linux-androideabi" 36 config.sysroot = os.path.join(ndk, "platforms/android-21/arch-arm/") 37 config.gcc_toolchain = os.path.join( 38 top, "prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9") 39 40 # Let the main config do the real work. 41 lit_config.load_config( 42 config, os.path.join(top, "external/libcxx/test/lit.cfg")) 43