r221391 - cmake: Conditionalize CodeGen's dependency on intrinsics_gen

Reid Kleckner reid at kleckner.net
Wed Nov 5 12:30:56 PST 2014


Author: rnk
Date: Wed Nov  5 14:30:55 2014
New Revision: 221391

URL: http://llvm.org/viewvc/llvm-project?rev=221391&view=rev
Log:
cmake: Conditionalize CodeGen's dependency on intrinsics_gen

Custom targets in cmake cannot be exported, and this dependency is only
needed in the combined build to ensure that Intrinsics.gen is created
before compiling CodeGen. In the standalone, all of LLVM is build first.

Modified:
    cfe/trunk/lib/CodeGen/CMakeLists.txt

Modified: cfe/trunk/lib/CodeGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CMakeLists.txt?rev=221391&r1=221390&r2=221391&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CMakeLists.txt (original)
+++ cfe/trunk/lib/CodeGen/CMakeLists.txt Wed Nov  5 14:30:55 2014
@@ -16,6 +16,15 @@ set(LLVM_LINK_COMPONENTS
   TransformUtils
   )
 
+# In a standard Clang+LLVM build, we need to generate intrinsics before
+# building codegen. In a standalone build, LLVM is already built and we don't
+# need this dependency. Furthermore, LLVM doesn't export it so we can't have
+# this dependency.
+set(codegen_deps intrinsics_gen)
+if (CLANG_BUILT_STANDALONE)
+  set(codegen_deps)
+endif()
+
 add_clang_library(clangCodeGen
   BackendUtil.cpp
   CGAtomic.cpp
@@ -65,7 +74,7 @@ add_clang_library(clangCodeGen
   TargetInfo.cpp
 
   DEPENDS
-  intrinsics_gen
+  ${codegen_deps}
 
   LINK_LIBS
   clangAST





More information about the cfe-commits mailing list