summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index 2c38c24d677..10c2409f6bf 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -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
OpenPOWER on IntegriCloud