[libcxx-commits] [PATCH] D111672: [runtimes] Properly handle the sysroot/triple/gcc-toolchain

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 18 12:45:02 PDT 2021


phosek added a comment.

I wonder if we can deprecate `LIBCXX_TARGET_TRIPLE`, `LIBCXX_SYSROOT`, and `LIBCXX_GCC_TOOLCHAIN` (and their libc++abi and libunwind counterparts), and switch to the CMake variables instead? Do those custom variables give us anything?



================
Comment at: libcxx/CMakeLists.txt:279-281
+set(LIBCXX_TARGET_TRIPLE "${LIBCXX_DEFAULT_TARGET_TRIPLE}" CACHE STRING "Use alternate target triple.")
+set(LIBCXX_SYSROOT "${CMAKE_SYSROOT}" CACHE STRING "Use alternate sysroot.")
+set(LIBCXX_GCC_TOOLCHAIN "${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}" CACHE STRING "Use alternate GCC toolchain.")
----------------
This changes the semantics slightly. Previously the values of `LIBCXX_TARGET_TRIPLE`, `LIBCXX_SYSROOT`, and `LIBCXX_GCC_TOOLCHAIN` wouldn't be cached, so if you changed `CMAKE_CXX_COMPILER_TARGET`, `CMAKE_SYSROOT`, or `CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN` those changes would be immediately picked. Now, you'll have to modify `LIBCXX_TARGET_TRIPLE`, `LIBCXX_SYSROOT`, and `LIBCXX_GCC_TOOLCHAIN` instead because any subsequent changes to `CMAKE_CXX_COMPILER_TARGET`, `CMAKE_SYSROOT`, or `CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN` would be ignored.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111672



More information about the libcxx-commits mailing list