[PATCH] D32816: [CMake] Support multi-target runtimes build

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 11:44:36 PDT 2017


phosek added inline comments.


================
Comment at: cmake/modules/LLVMExternalProjectUtils.cmake:198
   foreach(target ${ARG_EXTRA_TARGETS})
+    string(REPLACE ":" ";" target_list ${target})
+    list(GET target_list 0 target)
----------------
beanz wrote:
> I'm a little confused why this is needed. Isn't `ARG_EXTRA_TARGETS` a list? This code looks like it is expecting `ARG_EXTRA_TARGETS` to be a list of lists where the inner list is colon-separated instead of semi-colon separated.
Yes, correct. The problem is that `llvm_ExternalProject_Add` adds a custom target with the `${target}` name that triggers a build for external project's `${target}` target. In a single target scenario, this is fine because both targets would be something like `install-asan`, but in multi-target case we need to use a different target name in the main project to avoid collision (e.g. `x86_64-unknown-linux-gnu-install-asan`) and different in the subproject (i.e. `install-asan`), so I use `:` to optionally separate subproject target name from the target name. I don't know what would be the best way to do this, I also considered using global variables (.e.g `<target>_TARGET_NAME`  but that feels icky) or maybe an additional argument?


Repository:
  rL LLVM

https://reviews.llvm.org/D32816





More information about the llvm-commits mailing list