[libcxx-commits] [PATCH] D110005: [WIP][CMake] Unify variable names

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 20 15:53:49 PDT 2021


phosek added a comment.

In D110005#3010694 <https://reviews.llvm.org/D110005#3010694>, @compnerd wrote:

> While I think that the direction of this change is amazing, I'm less enthusiastic about the naming.  I think that it is particularly confusing for the flags to use `C` and `CXX` as the prefixes for the flags as we have llvm-libc (aka "c") and libc++ (aka "c++", "cxx").  Using a more verbose name of `COMPILER_` or `C_COMPILER_`, `CXX_COMPILER_` would allow the flags to be easily attributed to the compiler or the runtime.  However, the C standard flags definitely should be dropped.

This is exactly the kind of suggestion I was looking for, thanks! I'm fine with either, the only reason why `C_COMPILER_`/`CXX_COMPILER_` might be preferable over simple `COMPILER_` is if there we ever wanted to distinguish between flags supported by C and C++ compiler (in particular if there was a flag that was only supported in one mode but not the other). I'm not sure if that's ever going to be the case?

Do you have any thoughts on variable naming for libraries? We seem to have HAVE_LIBPTHREAD <https://github.com/llvm/llvm-project/blob/4edf46f72a8f3bd9d60628d0c852e8ff91921673/llvm/cmake/config-ix.cmake#L88>, LIBCXX_HAS_PTHREAD_LIB <https://github.com/llvm/llvm-project/blob/4edf46f72a8f3bd9d60628d0c852e8ff91921673/libcxx/cmake/config-ix.cmake#L95> and COMPILER_RT_HAS_LIBPTHREAD <https://github.com/llvm/llvm-project/blob/4edf46f72a8f3bd9d60628d0c852e8ff91921673/compiler-rt/cmake/config-ix.cmake#L142>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110005



More information about the libcxx-commits mailing list