[PATCH] D133890: [CMake] Do these replacements to make use of D132608

2022-11-07 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 updated this revision to Diff 473684.
Ericson2314 added a comment.
Herald added a subscriber: Moerafaat.

Rebase, rename variables


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133890

Files:
  bolt/tools/driver/CMakeLists.txt
  clang/CMakeLists.txt
  clang/cmake/caches/Fuchsia-stage2.cmake
  clang/cmake/modules/CMakeLists.txt
  clang/tools/scan-build-py/CMakeLists.txt
  clang/tools/scan-build/CMakeLists.txt
  clang/tools/scan-view/CMakeLists.txt
  flang/CMakeLists.txt
  flang/cmake/modules/CMakeLists.txt
  flang/tools/f18/CMakeLists.txt
  libc/test/utils/tools/WrapperGen/CMakeLists.txt
  libcxxabi/CMakeLists.txt
  lld/cmake/modules/CMakeLists.txt
  lldb/bindings/python/CMakeLists.txt
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/cmake/modules/LLDBStandalone.cmake
  mlir/cmake/modules/CMakeLists.txt
  mlir/examples/standalone/CMakeLists.txt
  mlir/test/CMakeLists.txt
  mlir/utils/mbr/CMakeLists.txt
  openmp/libomptarget/plugins/remote/CMakeLists.txt

Index: openmp/libomptarget/plugins/remote/CMakeLists.txt
===
--- openmp/libomptarget/plugins/remote/CMakeLists.txt
+++ openmp/libomptarget/plugins/remote/CMakeLists.txt
@@ -26,7 +26,7 @@
 
 if (Protobuf_FOUND AND gRPC_FOUND AND PROTOC AND GRPC_CPP_PLUGIN)
   libomptarget_say("Building remote offloading plugin.")
-  set(directory "${CMAKE_BINARY_DIR}/include/openmp/libomptarget/plugins/remote/")
+  set(directory "${LLVMPROJ_BINARY_INCLUDEDIR}/openmp/libomptarget/plugins/remote/")
   file(MAKE_DIRECTORY ${directory})
   execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${directory})
   execute_process(
Index: mlir/utils/mbr/CMakeLists.txt
===
--- mlir/utils/mbr/CMakeLists.txt
+++ mlir/utils/mbr/CMakeLists.txt
@@ -1 +1 @@
-configure_file(mlir-mbr.in ${CMAKE_BINARY_DIR}/bin/mlir-mbr @ONLY)
+configure_file(mlir-mbr.in ${LLVMPROJ_BINARY_BINDIR}/mlir-mbr @ONLY)
Index: mlir/test/CMakeLists.txt
===
--- mlir/test/CMakeLists.txt
+++ mlir/test/CMakeLists.txt
@@ -8,7 +8,7 @@
 # Provide the MLIR CMake module dir so that the out of tree Standalone
 # dialect and can add it to the module path.
 set(MLIR_CMAKE_DIR
-  "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir")
+  "${LLVMPROJ_BINARY_LIBDIR}/cmake/mlir")
 
 # Passed to lit.site.cfg.py.in to set up the path where to find libraries.
 set(MLIR_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
Index: mlir/examples/standalone/CMakeLists.txt
===
--- mlir/examples/standalone/CMakeLists.txt
+++ mlir/examples/standalone/CMakeLists.txt
@@ -10,8 +10,8 @@
 message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
 message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
 
-set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)
-set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
+set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVMPROJ_BINARY_BINDIR})
+set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVMPROJ_BINARY_LIBDIR})
 set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})
 
 list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
Index: mlir/cmake/modules/CMakeLists.txt
===
--- mlir/cmake/modules/CMakeLists.txt
+++ mlir/cmake/modules/CMakeLists.txt
@@ -9,7 +9,7 @@
 set(MLIR_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/mlir" CACHE STRING
   "Path for CMake subdirectory for Polly (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/polly')")
 # CMAKE_INSTALL_PACKAGEDIR might be absolute, so don't reuse below.
-set(mlir_cmake_builddir "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir")
+set(mlir_cmake_builddir "${LLVMPROJ_BINARY_LIBDIR}/cmake/mlir")
 
 # Keep this in sync with llvm/cmake/CMakeLists.txt!
 set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING
Index: lldb/cmake/modules/LLDBStandalone.cmake
===
--- lldb/cmake/modules/LLDBStandalone.cmake
+++ lldb/cmake/modules/LLDBStandalone.cmake
@@ -79,7 +79,7 @@
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 include_directories(
-  "${CMAKE_BINARY_DIR}/include"
+  "${LLVMPROJ_BINARY_INCLUDEDIR}"
   "${LLVM_INCLUDE_DIRS}"
   "${CLANG_INCLUDE_DIRS}")
 
@@ -109,6 +109,6 @@
   set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
 endif()
 
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVMPROJ_BINARY_BINDIR})
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVMPROJ_BINARY_LIBDIR})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVMPROJ_BINARY_LIBDIR})
Index: lldb/cmake/modules/LLDBConfig.cmake

[PATCH] D133890: [CMake] Do these replacements to make use of D132608

2022-09-19 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment.

I don't see anything wrong with this change per se, but I'm conflicted on the 
name of the variable.  These are not standard variables but are encroaching on 
the CMake namespace.  What happens if upstream decides to use these names?  I 
think that we should keep the names in the `LLVM_` namespace.  However, I 
realize that the variable itself is not being touched here and this is a 
mechanical replacement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133890

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D133890: [CMake] Do these replacements to make use of D132608

2022-09-14 Thread John Ericson via Phabricator via cfe-commits
Ericson2314 created this revision.
Ericson2314 added reviewers: phosek, ldionne, sebastian-ne, beanz.
Herald added subscribers: libc-commits, bzcheeseman, ayermolo, sdasgup3, 
abrachet, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, 
jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, 
antiagainst, shauheen, rriddle, mehdi_amini, whisperity, mgorny.
Herald added a reviewer: sscalpone.
Herald added a reviewer: awarzynski.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a reviewer: NoQ.
Herald added projects: libc-project, Flang, All.
Ericson2314 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, libcxx-commits, openmp-commits, 
lldb-commits, cfe-commits, yota9, sstefan1, stephenneuendorffer, 
nicolasvasilache, jdoerfert.
Herald added projects: clang, LLDB, OpenMP, libc++abi, MLIR, LLVM.
Herald added a reviewer: libc++abi.

D132608  defined new `CMAKE_BINARY_*DIR` 
variables to match
`GNUInstallDirs`. Now we actually use them!

- `${CMAKE_BINARY_DIR}/lib(${CMAKE_LIBDIR_SUFFIX})?\>` -> 
`${CMAKE_BINARY_LIBDIR}`
- `${CMAKE_BINARY_DIR}/bin\>` -> `${CMAKE_BINARY_BINDIR}`

- `${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}` -> 
`${LLVM_LIBRARY_OUTPUT_INTDIR}`
- `${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin` -> 
`${LLVM_RUNTIME_OUTPUT_INTDIR}`

It is somewhat odd to me that those last two vars start with `LLVM_`
not `CMAKE_` when they are based on `CMAKE_BINARY_DIR`, but that can
be tackled some other time.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133890

Files:
  bolt/tools/driver/CMakeLists.txt
  clang/CMakeLists.txt
  clang/cmake/caches/Fuchsia-stage2.cmake
  clang/cmake/modules/CMakeLists.txt
  clang/tools/scan-build-py/CMakeLists.txt
  clang/tools/scan-build/CMakeLists.txt
  clang/tools/scan-view/CMakeLists.txt
  flang/CMakeLists.txt
  flang/cmake/modules/CMakeLists.txt
  flang/tools/f18/CMakeLists.txt
  libc/test/utils/tools/WrapperGen/CMakeLists.txt
  libcxxabi/CMakeLists.txt
  lld/cmake/modules/CMakeLists.txt
  lldb/bindings/python/CMakeLists.txt
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/cmake/modules/LLDBStandalone.cmake
  llvm/tools/llvm-go/CMakeLists.txt
  mlir/cmake/modules/CMakeLists.txt
  mlir/examples/standalone/CMakeLists.txt
  mlir/test/CMakeLists.txt
  mlir/utils/mbr/CMakeLists.txt
  openmp/libomptarget/plugins/remote/CMakeLists.txt

Index: openmp/libomptarget/plugins/remote/CMakeLists.txt
===
--- openmp/libomptarget/plugins/remote/CMakeLists.txt
+++ openmp/libomptarget/plugins/remote/CMakeLists.txt
@@ -26,7 +26,7 @@
 
 if (Protobuf_FOUND AND gRPC_FOUND AND PROTOC AND GRPC_CPP_PLUGIN)
   libomptarget_say("Building remote offloading plugin.")
-  set(directory "${CMAKE_BINARY_DIR}/include/openmp/libomptarget/plugins/remote/")
+  set(directory "${CMAKE_BINARY_INCLUDEDIR}/openmp/libomptarget/plugins/remote/")
   file(MAKE_DIRECTORY ${directory})
   execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${directory})
   execute_process(
Index: mlir/utils/mbr/CMakeLists.txt
===
--- mlir/utils/mbr/CMakeLists.txt
+++ mlir/utils/mbr/CMakeLists.txt
@@ -1 +1 @@
-configure_file(mlir-mbr.in ${CMAKE_BINARY_DIR}/bin/mlir-mbr @ONLY)
+configure_file(mlir-mbr.in ${CMAKE_BINARY_BINDIR}/mlir-mbr @ONLY)
Index: mlir/test/CMakeLists.txt
===
--- mlir/test/CMakeLists.txt
+++ mlir/test/CMakeLists.txt
@@ -8,7 +8,7 @@
 # Passed to lit.site.cfg.py.so that the out of tree Standalone dialect test
 # can find MLIR's CMake configuration
 set(MLIR_CMAKE_DIR
-  "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir")
+  "${CMAKE_BINARY_LIBDIR}/cmake/mlir")
 
 # Passed to lit.site.cfg.py.in to set up the path where to find libraries.
 set(MLIR_LIB_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
Index: mlir/examples/standalone/CMakeLists.txt
===
--- mlir/examples/standalone/CMakeLists.txt
+++ mlir/examples/standalone/CMakeLists.txt
@@ -10,8 +10,8 @@
 message(STATUS "Using MLIRConfig.cmake in: ${MLIR_DIR}")
 message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
 
-set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)
-set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
+set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_BINDIR})
+set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_LIBDIR})
 set(MLIR_BINARY_DIR ${CMAKE_BINARY_DIR})
 
 list(APPEND CMAKE_MODULE_PATH "${MLIR_CMAKE_DIR}")
Index: mlir/cmake/modules/CMakeLists.txt
===
--- mlir/cmake/modules/CMakeLists.txt
+++ mlir/cmake/modules/CMakeLists.txt
@@ -9,7 +9,7 @@
 set(MLIR_INSTALL_PACKAGE_DIR