2014-07-10 10:20:11 +08:00
|
|
|
@AUTO_GEN_COMMENT@
|
2020-06-25 23:46:00 +08:00
|
|
|
|
|
|
|
import os
|
|
|
|
import site
|
|
|
|
|
2020-07-16 18:03:00 +08:00
|
|
|
config.cxx_under_test = "@CMAKE_CXX_COMPILER@"
|
2015-10-15 02:20:48 +08:00
|
|
|
config.project_obj_root = "@CMAKE_BINARY_DIR@"
|
2015-01-22 07:06:22 +08:00
|
|
|
config.libcxxabi_src_root = "@LIBCXXABI_SOURCE_DIR@"
|
2015-02-11 09:07:48 +08:00
|
|
|
config.libcxxabi_obj_root = "@LIBCXXABI_BINARY_DIR@"
|
2015-03-18 03:45:21 +08:00
|
|
|
config.abi_library_path = "@LIBCXXABI_LIBRARY_DIR@"
|
2015-01-23 04:00:06 +08:00
|
|
|
config.libcxx_src_root = "@LIBCXXABI_LIBCXX_PATH@"
|
2017-04-04 22:03:54 +08:00
|
|
|
config.libunwind_headers = "@LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL@"
|
2015-03-18 02:58:14 +08:00
|
|
|
config.cxx_library_root = "@LIBCXXABI_LIBCXX_LIBRARY_PATH@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.llvm_unwinder = @LIBCXXABI_USE_LLVM_UNWINDER@
|
2019-02-06 03:50:47 +08:00
|
|
|
config.builtins_library = "@LIBCXXABI_BUILTINS_LIBRARY@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.enable_threads = @LIBCXXABI_ENABLE_THREADS@
|
2015-01-22 07:06:22 +08:00
|
|
|
config.use_sanitizer = "@LLVM_USE_SANITIZER@"
|
2018-10-11 06:00:58 +08:00
|
|
|
config.sanitizer_library = "@LIBCXXABI_SANITIZER_LIBRARY@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.enable_32bit = @LIBCXXABI_BUILD_32_BITS@
|
2015-02-26 23:55:01 +08:00
|
|
|
config.target_info = "@LIBCXXABI_TARGET_INFO@"
|
|
|
|
config.executor = "@LIBCXXABI_EXECUTOR@"
|
[libcxxabi] Allow tests to link with static libc++abi/libc++ even if the shared version is present
Summary:
Right now the only way to force libc++abi tests to link with the static version of libc++abi is to set `LIBCXXABI_ENABLE_SHARED` to `OFF`. However, this doesn't work when libc++abi is built as standalone project because of [this](https://github.com/llvm/llvm-project/blob/54c522420347e58aa7bae1892cf5c5672b57c875/libcxxabi/CMakeLists.txt#L503-L519).
This change allows specifying the version of the library for tests to link with.
This is useful for remote testing, for example, with `SSHExecutor`, where we _have_ to link with libc++abi statically.
Two new CMake options are introduced here: `LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI` and `LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX`. They can be set to `OFF` to tell the test utility to link tests with the static libraries.
It shouldn't break anything, because the default values of these options are set such that the test utility will behave the same way.
Reviewers: EricWF, mclow.lists, phosek, mehdi_amini, ldionne, jroelofs, bcraig
Subscribers: mgorny, christof, ldionne, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D71894
2019-12-26 17:28:39 +08:00
|
|
|
config.libcxxabi_shared = @LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI@
|
|
|
|
config.enable_shared = @LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX@
|
2019-02-05 12:44:03 +08:00
|
|
|
config.enable_exceptions = @LIBCXXABI_ENABLE_EXCEPTIONS@
|
2016-11-13 22:44:41 +08:00
|
|
|
config.host_triple = "@LLVM_HOST_TRIPLE@"
|
|
|
|
config.target_triple = "@TARGET_TRIPLE@"
|
2017-12-12 09:20:37 +08:00
|
|
|
config.sysroot = "@LIBCXXABI_SYSROOT@"
|
|
|
|
config.gcc_toolchain = "@LIBCXXABI_GCC_TOOLCHAIN@"
|
2019-02-05 12:44:03 +08:00
|
|
|
config.cxx_ext_threads = @LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY@
|
2014-07-10 10:20:11 +08:00
|
|
|
|
2019-08-08 20:43:20 +08:00
|
|
|
config.pstl_src_root = "@ParallelSTL_SOURCE_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
|
|
|
|
config.pstl_obj_root = "@ParallelSTL_BINARY_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
|
|
|
|
|
2020-06-25 23:46:00 +08:00
|
|
|
# Code signing
|
2020-06-23 21:02:53 +08:00
|
|
|
config.llvm_codesign_identity = "@LLVM_CODESIGNING_IDENTITY@"
|
|
|
|
|
2020-06-25 23:46:00 +08:00
|
|
|
site.addsitedir(os.path.join(config.libcxxabi_src_root, 'test'))
|
|
|
|
site.addsitedir(os.path.join(config.libcxx_src_root, 'utils'))
|
|
|
|
|
|
|
|
# name: The name of this test suite.
|
|
|
|
config.name = 'libc++abi'
|
|
|
|
|
|
|
|
# suffixes: A list of file extensions to treat as test files.
|
|
|
|
config.suffixes = ['.cpp', '.s']
|
|
|
|
|
|
|
|
# test_source_root: The root path where tests are located.
|
|
|
|
config.test_source_root = os.path.join(config.libcxxabi_src_root, 'test')
|
|
|
|
|
|
|
|
# Allow expanding substitutions that are based on other substitutions
|
|
|
|
config.recursiveExpansionLimit = 10
|
|
|
|
|
|
|
|
# Infer the test_exec_root from the build directory.
|
|
|
|
config.test_exec_root = os.path.join(config.libcxxabi_obj_root, 'test')
|
|
|
|
|
2020-06-30 22:10:30 +08:00
|
|
|
import libcxx.test.format
|
|
|
|
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
|
2020-06-26 12:55:29 +08:00
|
|
|
|
2020-06-25 23:46:00 +08:00
|
|
|
lit_config.note('Using configuration variant: libcxxabi')
|
|
|
|
import libcxxabi.test.config
|
|
|
|
configuration = libcxxabi.test.config.Configuration(lit_config, config)
|
|
|
|
configuration.configure()
|
|
|
|
configuration.print_config_info()
|