[libcxx-commits] [PATCH] D89813: [CMake][NFC] Limit the use of uppercase_CMAKE_BUILD_TYPE

Christopher Tetreault via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 20 11:29:40 PDT 2020


ctetreau created this revision.
Herald added subscribers: llvm-commits, libcxx-commits, lldb-commits, Sanitizers, lebedev.ri, hiraditya, arichardson, mgorny.
Herald added a reviewer: lebedev.ri.
Herald added projects: Sanitizers, LLDB, libc++, libc++abi, libunwind, LLVM.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.
Herald added a reviewer: libunwind.
ctetreau requested review of this revision.
Herald added a subscriber: JDevlieghere.

uppercase_CMAKE_BUILD_TYPE is often defined to be
toupper(CMAKE_BUILD_TYPE). This is sometimes neccesary when trying to
programatically inspect the values of builtin cmake variables that have
the build type as part of the name. However, this variable is also often
used to just check the build type.

The use of this variable is error prone because it is not a builtin variable.
Users may add a usage of it without defining it. Since CMake treats undefined
variables as being defined to the empty string, this will not cause any sort
of error. It may even be the case that it appears to work for the author
and bad code makes it into master. (D89807 <https://reviews.llvm.org/D89807>)

This patch removes unneccesary usages of uppercase_CMAKE_BUILD_TYPE.
Remaining usages of it are needed to construct variable names such as
`CMAKE_CXX_FLAGS_DEBUG`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89813

Files:
  compiler-rt/cmake/Modules/AddCompilerRT.cmake
  libcxx/CMakeLists.txt
  libcxx/utils/google-benchmark/test/CMakeLists.txt
  libcxxabi/CMakeLists.txt
  libunwind/CMakeLists.txt
  lldb/CMakeLists.txt
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/AddOCaml.cmake
  llvm/cmake/modules/HandleLLVMOptions.cmake
  llvm/cmake/modules/TableGen.cmake
  llvm/lib/Support/CMakeLists.txt
  llvm/utils/benchmark/test/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89813.299430.patch
Type: text/x-patch
Size: 13447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201020/ff9bc826/attachment-0001.bin>


More information about the libcxx-commits mailing list