[libcxx-commits] [PATCH] D115398: [libcxx] Use LIBCXX_EXECUTOR, LIBCXX_TEST_COMPILER_FLAGS and LIBCXX_TEST_LINKER_FLAGS in new test configs

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 8 14:40:02 PST 2021


mstorsjo added a comment.

In D115398#3181137 <https://reviews.llvm.org/D115398#3181137>, @ldionne wrote:

> Can you make similar changes to libcxxabi?

Sure, I can give that a go tomorrow.



================
Comment at: libcxx/test/configs/cmake-bridge.cfg.in:33-34
+config.substitutions.append(('%{executor}', '@LIBCXX_EXECUTOR@'))
+config.substitutions.append(('%{user_compile_flags}', '@LIBCXX_TEST_COMPILER_FLAGS@'))
+config.substitutions.append(('%{user_link_flags}', '@LIBCXX_TEST_LINKER_FLAGS@'))
----------------
ldionne wrote:
> About these two -- I would actually love to get rid of them. Instead, you could create your own simple `.cfg.in` file for MingGW where you set the required flags.
> 
> I loathe forwarding flags from CMake to the Lit config, IMO that's just unnecessary plumbing.
I know you're not a fan of such settings, but I find them vital. I, on the other hand, loathe setups where it's only possible to build and run things in a finite, fixed set of configurations, instead of passing individual options for configuring one's build.

Sure we can only test and support a finite, fixed set of configurations, but it should be possible for vendors to build and test in other configs by just configuring things with additional flags on top of the existing configs, as long as it's not different enough warranting a separate config.

As a very concrete example; for the clang-cl builds, we currently build and test with setting `-DCMAKE_CXX_FLAGS="-D_LIBCPP_HAS_NO_INT128" -DLIBCXX_TEST_COMPILER_FLAGS="-D_LIBCPP_HAS_NO_INT128"`. I've considered extending it so we'd test both in the default configuration (with filesystem disabled) and this config (with int128 disabled so that msvc environments can test filesystem). That would require adding a separate test config file for that too.

And when such a detail is configured by adding things to `CMAKE_CXX_FLAGS`, it's best if the corresponding flag for tests can be passed in tandem right next to it, via `LIBCXX_TEST_COMPILER_FLAGS` to cmake, instead of using a separate test config for it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115398/new/

https://reviews.llvm.org/D115398



More information about the libcxx-commits mailing list