[PATCH] D57406: build: remove use of llvm-config

Alex Langford via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 31 00:31:07 PST 2019


xiaobai requested changes to this revision.
xiaobai added a comment.
This revision now requires changes to proceed.

After taking the time to go through this more thoroughly I realized there were several issues that need to be addressed before this can go in.

I also found that testing is broken with LLD standalone builds. Specifically, I ran `ninja check-lld` and that doesn't work because it tries to use `llvm-lit` from the lld build tree. This patch is not at fault, as it fails the same way with or without this patch. I think this could be addressed in a later patch.



================
Comment at: CMakeLists.txt:10
+  find_package(LLVM REQUIRED CONFIG NO_CMAKE_FIND_ROOT_PATH)
   list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+  set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
----------------
This should be changed to `LLVM_CMAKE_DIR` or `LLVM_DIR` (Both of these directories will have the LLVM CMake modules). As-is, `LLVM_CMAKE_PATH` is not set.


================
Comment at: CMakeLists.txt:11
   list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+  set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
----------------
You also will need to set `LLVM_MAIN_INCLUDE_DIR` here or else TableGen won't include that path by default. Something like this should work:
`set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include")`


================
Comment at: CMakeLists.txt:33
+    if(NOT CMAKE_CONFIGURATION_TYPES)
+      find_program(LLVM_TABLEGEN_EXE
+        "${LLVM_NATIVE_BUILD_DIR}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
----------------
`find_program` -> `set`


================
Comment at: CMakeLists.txt:38
+      # CrossCompile.cmake
+      find_program(LLVM_TABLEGEN_EXE
+        "${LLVM_NATIVE_BUILD_DIR}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
----------------
`find_program` -> `set`


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D57406





More information about the llvm-commits mailing list