]> granicus.if.org Git - clang/commitdiff
cmake: Conditionalize CodeGen's dependency on intrinsics_gen
authorReid Kleckner <reid@kleckner.net>
Wed, 5 Nov 2014 20:30:55 +0000 (20:30 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 5 Nov 2014 20:30:55 +0000 (20:30 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221391 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CMakeLists.txt

index 2c38c24d677356f4f56acaf3a5391d61eacfb4ef..10c2409f6bff5e2492d3c19fa2871f5ece140765 100644 (file)
@@ -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