2014-07-10 10:20:11 +08:00
|
|
|
@AUTO_GEN_COMMENT@
|
2015-01-22 07:06:22 +08:00
|
|
|
config.cxx_under_test = "@LIBCXXABI_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@"
|
2015-01-22 07:06:22 +08:00
|
|
|
config.cxx_headers = "@LIBCXXABI_LIBCXX_INCLUDES@"
|
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@"
|
[CMake] Support CMake variables for setting target, sysroot and toolchain
CMake has a standard way of setting target triple, sysroot and external
toolchain through CMAKE_<LANG>_COMPILER_TARGET, CMAKE_SYSROOT and
CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN. These are turned into
corresponding --target=, --sysroot= and --gcc-toolchain= variables add
included appended to CMAKE_<LANG>_FLAGS.
libunwind, libc++abi, libc++ provides their own mechanism through
<PROJECT>_TARGET_TRIPLE, <PROJECT>_SYSROOT and <PROJECT>_GCC_TOOLCHAIN
variables. These are also passed to lit via lit.site.cfg, and lit config
uses these to set the corresponding compiler flags when building tessts.
This means that there are two different ways of setting target, sysroot
and toolchain, but only one is properly supported in lit. This change
extends CMake build for libunwind, libc++abi and libc++ to also support
the CMake variables in addition to project specific ones in lit.
Differential Revision: https://reviews.llvm.org/D57670
llvm-svn: 353084
2019-02-05 04:02:26 +08:00
|
|
|
config.use_target = bool("@LIBCXXABI_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-23 21:02:53 +08:00
|
|
|
config.llvm_codesign_identity = "@LLVM_CODESIGNING_IDENTITY@"
|
|
|
|
|
2014-07-10 10:20:11 +08:00
|
|
|
# Let the main config do the real work.
|
|
|
|
lit_config.load_config(config, "@LIBCXXABI_SOURCE_DIR@/test/lit.cfg")
|