[PATCH] D27386: build: add support for standalone lld build

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 09:41:06 PST 2016


beanz added inline comments.


================
Comment at: CMakeLists.txt:22
+  string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" LLVM_CONFIG_OUTPUT ${LLVM_CONFIG_OUTPUT})
+  list(GET LLVM_CONFIG_OUTPUT 0 OBJ_ROOT)
+  list(GET LLVM_CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
----------------
I think this is the only variable from llvm-config that you need. The others can all be read from LLVMConfig.cmake.

Even this one we could potentially get rid of if we made use of CMake's `find_package` mechanism.


================
Comment at: CMakeLists.txt:23
+  list(GET LLVM_CONFIG_OUTPUT 0 OBJ_ROOT)
+  list(GET LLVM_CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+  list(GET LLVM_CONFIG_OUTPUT 2 MAIN_SRC_DIR)
----------------
This is equivalent to `LLVM_TOOLS_BINARY_DIR` which is set in LLVMConfig.cmake.


================
Comment at: CMakeLists.txt:24
+  list(GET LLVM_CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+  list(GET LLVM_CONFIG_OUTPUT 2 MAIN_SRC_DIR)
+  list(GET LLVM_CONFIG_OUTPUT 3 MAIN_INCLUDE_DIR)
----------------
If you're building against a build tree, instead of an install, this is exposed as `LLVM_BUILD_MAIN_SRC_DIR` in LLVMConfig.cmake. If you're not building against a build tree, we actually don't know if you have a source dir, so there is no path.


================
Comment at: CMakeLists.txt:25
+  list(GET LLVM_CONFIG_OUTPUT 2 MAIN_SRC_DIR)
+  list(GET LLVM_CONFIG_OUTPUT 3 MAIN_INCLUDE_DIR)
+  list(GET LLVM_CONFIG_OUTPUT 4 LIBRARY_DIR)
----------------
This is equivalent to `LLVM_INCLUDE_DIRS` which is set in LLVMConfig.cmake.


================
Comment at: CMakeLists.txt:26
+  list(GET LLVM_CONFIG_OUTPUT 3 MAIN_INCLUDE_DIR)
+  list(GET LLVM_CONFIG_OUTPUT 4 LIBRARY_DIR)
+
----------------
This is equivalent to `LLVM_LIBRARY_DIRS` which is set in LLVMConfig.cmake.


Repository:
  rL LLVM

https://reviews.llvm.org/D27386





More information about the llvm-commits mailing list