Home | History | Annotate | Download | only in test
      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 libcxx_dir = os.path.join(ndk, 'sources/cxx-stl/llvm-libc++')
     15 libcxx_src_dir = os.path.join(libcxx_dir, 'libcxx')
     16 
     17 config.cxx_under_test = os.path.join(
     18     ndk, "toolchains/llvm/prebuilt/linux-x86_64/bin/clang++")
     19 config.std = "c++11"
     20 config.libcxx_src_root = libcxx_src_dir
     21 config.libcxx_obj_root = libcxx_src_dir
     22 config.cxx_library_root = os.path.join(libcxx_dir, 'libs/%ABI%')
     23 config.enable_exceptions = "True"
     24 config.enable_rtti = "True"
     25 config.enable_shared = "False"
     26 config.enable_32bit = "False"
     27 config.enable_threads = "True"
     28 config.enable_monotonic_clock = "True"
     29 config.cxx_abi = "libcxxabi"
     30 config.use_sanitizer = ""
     31 config.configuration_variant = "libcxx.ndk"
     32 config.target_triple = "%TRIPLE%"
     33 config.sysroot = os.path.join(ndk, "platforms/android-21/arch-%ARCH%/")
     34 config.gcc_toolchain = os.path.join(
     35     ndk, "toolchains/%TRIPLE%-4.9/prebuilt/linux-x86_64")
     36 
     37 # Let the main config do the real work.
     38 lit_config.load_config(
     39     config, os.path.join(libcxx_src_dir, "test/lit.cfg"))
     40