[Lldb-commits] [PATCH] D132608: [CMake] Clean up CMake binary dir handling

John Ericson via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 13 22:15:34 PDT 2022


Ericson2314 added inline comments.


================
Comment at: cmake/Modules/GNUBinaryDirs.cmake:3
+  get_filename_component(CMAKE_LIBDIR_BASENAME "${CMAKE_INSTALL_LIBDIR}" NAME)
+endif()
+
----------------
compnerd wrote:
> Should this perhaps be moved further down near the usage?
Sure


================
Comment at: cmake/Modules/GNUBinaryDirs.cmake:6
+if (NOT DEFINED CMAKE_BINARY_BINDIR)
+  set(CMAKE_BINARY_BINDIR "${CMAKE_BINARY_BINDIR}/bin")
+endif()
----------------
compnerd wrote:
> arichardson wrote:
> > I find this name a bit confusing, maybe something like `CMAKE_BUILD_BINDIR` (and the same for _LIBDIR/_INCLUDEDIR would be less surprising? That way it's clear that we are referring to binaries/libraries/includes in the build output (and it mirrors CMAKE_INSTALL_INCLUDEDIR, etc.) 
> I think you mean `${CMAKE_BINARY_DIR}/bin` as this is in a block where `CMAKE_BINARY_BINDIR` is undefined.
@compnerd oops thanks.

@arichardson `CMAKE_BINARY_*` is the already existing naming convention of built-in variables. I agree it is not the best, but I don't want to buck the standard.


================
Comment at: cmake/Modules/GNUBinaryDirs.cmake:10
+if (NOT DEFINED CMAKE_BINARY_INCLUDEDIR)
+  set(CMAKE_BINARY_INCLUDEDIR "${CMAKE_BINARY_DIR}/inc")
+endif()
----------------
compnerd wrote:
> Is the default spelling for include not `include` not `inc`?
Oops yes it is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132608



More information about the lldb-commits mailing list