From: Reid Kleckner Date: Wed, 5 Nov 2014 20:30:55 +0000 (+0000) Subject: cmake: Conditionalize CodeGen's dependency on intrinsics_gen X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e32d18fc20783bce0eecf15161a9f295b69dc67;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221391 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CMakeLists.txt b/lib/CodeGen/CMakeLists.txt index 2c38c24d67..10c2409f6b 100644 --- a/lib/CodeGen/CMakeLists.txt +++ b/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