llvm-project
40 строк · 1.4 Кб
1# This testing configuration handles running the test suite against LLVM's
2# libc++abi using adb and a libc++_shared.so library on Android.
3
4lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
5
6import re
7import site
8
9site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
10
11import libcxx.test.android
12import libcxx.test.config
13import libcxx.test.params
14
15config.substitutions.append(('%{flags}',
16'--sysroot @CMAKE_SYSROOT@' if '@CMAKE_SYSROOT@' else ''
17))
18config.substitutions.append(('%{compile_flags}',
19'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
20))
21
22# The NDK library is called "libc++_shared.so". Use LD_LIBRARY_PATH to find
23# libc++_shared.so because older Bionic dynamic loaders don't support rpath
24# lookup. The Android libc++ shared library exports libc++abi, so we don't need
25# to link with -lc++abi.
26config.substitutions.append(('%{link_flags}',
27'-nostdlib++ -L %{lib} -lc++_shared'
28))
29config.substitutions.append(('%{exec}',
30'%{executor}' +
31' --job-limit-socket ' + libcxx.test.android.adb_job_limit_socket() +
32' --prepend-path-env LD_LIBRARY_PATH /data/local/tmp/libc++ --execdir %T -- '
33))
34
35libcxx.test.config.configure(
36libcxx.test.params.DEFAULT_PARAMETERS,
37libcxx.test.features.DEFAULT_FEATURES,
38config,
39lit_config
40)
41