[PATCH] D99620: [CMake][Compiler-rt] Compute LLVM_MAIN_SRC_DIR assuming the monorepo layout.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 1 14:11:16 PDT 2021


mstorsjo added inline comments.


================
Comment at: compiler-rt/cmake/Modules/CompilerRTUtils.cmake:242
+    # Compute path to LLVM sources assuming the monorepo layout.
+    get_filename_component(LLVM_MAIN_SRC_DIR_DEFAULT "${CMAKE_CURRENT_SOURCE_DIR}/../llvm" ABSOLUTE)
+    if (NOT EXISTS "${LLVM_MAIN_SRC_DIR_DEFAULT}")
----------------
This is done within an `if (LLVM_CONFIG_PATH)` block. As we should work towards reducing the reliance on that, shouldn't we be doing this outside of that if statement?


================
Comment at: compiler-rt/cmake/Modules/CompilerRTUtils.cmake:265
+    if (NOT EXISTS "${LLVM_MAIN_SRC_DIR}")
+      message(FATAL_ERROR "LLVM_MAIN_SRC_DIR (${LLVM_MAIN_SRC_DIR}) does not exist")
+    endif()
----------------
Previously, not having this directory available wasn't a fatal error, now it is. Then again, as we should be able to pick it up from the monorepo so it's probably tolerable. (I'm not sure what effect this would start having on my builds though, that currently are done without including anything from llvm/cmake, but which now will start to find such things.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99620



More information about the llvm-commits mailing list