[Parallel_libs-commits] [PATCH] D24368: [StreamExecutor] Make SE work with an in-tree LLVM build.

James Price via Parallel_libs-commits parallel_libs-commits at lists.llvm.org
Fri Sep 9 09:27:58 PDT 2016


jprice added inline comments.

================
Comment at: streamexecutor/lib/CMakeLists.txt:2
@@ +1,3 @@
+macro(add_se_library name)
+  add_llvm_library(${name} ${ARGN})
+  set_target_properties(${name} PROPERTIES FOLDER "streamexecutor libraries")
----------------
jlebar wrote:
> jhen wrote:
> > This breaks the standalone build because it doesn't recognize `add_llvm_library`.
> Right.
> 
> I am not entirely hep to this jive, so I know I'm missing some stuff.  But lld uses add_llvm_library, and clang uses llvm_add_library (which would have the same problem?).
> 
> So my question is whether we can't do whatever they do, and be compatible with whatever types of builds they are compatible with?
> 
> If the standalone build uses llvm's headers, can it not also use its CMake files?
> 
> Same for add_unittest.
Looking at the Clang CMakeLists.txt, I believe the three magic lines that do this for standalone builds are these:

    set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
    list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
    include(AddLLVM)

If I add these to this patch, I can successfully build SE both standalone and in-tree. Disclaimer: I'm no CMake expert.



https://reviews.llvm.org/D24368





More information about the Parallel_libs-commits mailing list