[lld] 53880b8 - [CMake] Make `intrinsics_gen` dependency unconditional.
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 17 16:43:27 PDT 2020
Author: Michele Scandale
Date: 2020-07-17T16:43:17-07:00
New Revision: 53880b8cb9c61e81457d13c0adefe51ff41664fa
URL: https://github.com/llvm/llvm-project/commit/53880b8cb9c61e81457d13c0adefe51ff41664fa
DIFF: https://github.com/llvm/llvm-project/commit/53880b8cb9c61e81457d13c0adefe51ff41664fa.diff
LOG: [CMake] Make `intrinsics_gen` dependency unconditional.
The `intrinsics_gen` target exists in the CMake exports since r309389
(see LLVMConfig.cmake.in), hence projects can depend on `intrinsics_gen`
even it they are built separately from LLVM.
Reviewed By: MaskRay, JDevlieghere
Differential Revision: https://reviews.llvm.org/D83454
Added:
Modified:
clang/CMakeLists.txt
clang/lib/CodeGen/CMakeLists.txt
clang/lib/Frontend/CMakeLists.txt
clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
clang/tools/clang-import-test/CMakeLists.txt
clang/tools/clang-offload-bundler/CMakeLists.txt
clang/tools/clang-offload-wrapper/CMakeLists.txt
clang/tools/driver/CMakeLists.txt
lld/COFF/CMakeLists.txt
lld/Common/CMakeLists.txt
lld/ELF/CMakeLists.txt
lld/MinGW/CMakeLists.txt
lld/lib/Core/CMakeLists.txt
lld/wasm/CMakeLists.txt
lldb/CMakeLists.txt
lldb/source/Expression/CMakeLists.txt
lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
Removed:
################################################################################
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 7f8e0718c2eb..948452661a32 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -531,7 +531,7 @@ list(APPEND LLVM_COMMON_DEPENDS clang-tablegen-targets)
# Force target to be built as soon as possible. Clang modules builds depend
# header-wise on it as they ship all headers from the umbrella folders. Building
# an entire module might include header, which depends on intrinsics_gen.
-if(LLVM_ENABLE_MODULES AND NOT CLANG_BUILT_STANDALONE)
+if(LLVM_ENABLE_MODULES)
list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
endif()
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index c4bedf34921c..8afd7219fbe1 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -26,15 +26,6 @@ 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()
-
if (MSVC)
set_source_files_properties(CodeGenModule.cpp PROPERTIES COMPILE_FLAGS /bigobj)
endif()
@@ -99,7 +90,7 @@ add_clang_library(clangCodeGen
VarBypassDetector.cpp
DEPENDS
- ${codegen_deps}
+ intrinsics_gen
LINK_LIBS
clangAnalysis
diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt
index 0e23b92e2dea..af5446618b03 100644
--- a/clang/lib/Frontend/CMakeLists.txt
+++ b/clang/lib/Frontend/CMakeLists.txt
@@ -8,11 +8,6 @@ set(LLVM_LINK_COMPONENTS
Support
)
-set(optional_deps intrinsics_gen)
-if (CLANG_BUILT_STANDALONE)
- set(optional_deps)
-endif()
-
add_clang_library(clangFrontend
ASTConsumers.cpp
ASTMerge.cpp
@@ -49,7 +44,7 @@ add_clang_library(clangFrontend
DEPENDS
ClangDriverOptions
- ${optional_deps}
+ intrinsics_gen
LINK_LIBS
clangAST
diff --git a/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt b/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
index 47f9fdf68f40..9ceb1d331828 100644
--- a/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
+++ b/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
@@ -16,15 +16,9 @@ set(LLVM_LINK_COMPONENTS
native
)
-# Depend on LLVM IR intrinsic generation.
-set(handle_llvm_deps intrinsics_gen)
-if (CLANG_BUILT_STANDALONE)
- set(handle_llvm_deps)
-endif()
-
add_clang_library(clangHandleLLVM
handle_llvm.cpp
DEPENDS
- ${handle_llvm_deps}
+ intrinsics_gen
)
diff --git a/clang/tools/clang-import-test/CMakeLists.txt b/clang/tools/clang-import-test/CMakeLists.txt
index 4ccc2d752aac..e459de8f635f 100644
--- a/clang/tools/clang-import-test/CMakeLists.txt
+++ b/clang/tools/clang-import-test/CMakeLists.txt
@@ -3,14 +3,10 @@ set(LLVM_LINK_COMPONENTS
Support
)
-if(NOT CLANG_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_clang_executable(clang-import-test
clang-import-test.cpp
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
)
set(CLANG_IMPORT_TEST_LIB_DEPS
diff --git a/clang/tools/clang-offload-bundler/CMakeLists.txt b/clang/tools/clang-offload-bundler/CMakeLists.txt
index 4ef099493364..2738bf02e729 100644
--- a/clang/tools/clang-offload-bundler/CMakeLists.txt
+++ b/clang/tools/clang-offload-bundler/CMakeLists.txt
@@ -1,14 +1,10 @@
set(LLVM_LINK_COMPONENTS Object Support)
-if(NOT CLANG_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_clang_tool(clang-offload-bundler
ClangOffloadBundler.cpp
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
)
set(CLANG_OFFLOAD_BUNDLER_LIB_DEPS
diff --git a/clang/tools/clang-offload-wrapper/CMakeLists.txt b/clang/tools/clang-offload-wrapper/CMakeLists.txt
index 6f8940f88eab..8bcb46267a37 100644
--- a/clang/tools/clang-offload-wrapper/CMakeLists.txt
+++ b/clang/tools/clang-offload-wrapper/CMakeLists.txt
@@ -1,14 +1,10 @@
set(LLVM_LINK_COMPONENTS BitWriter Core Support TransformUtils)
-if(NOT CLANG_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_clang_tool(clang-offload-wrapper
ClangOffloadWrapper.cpp
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
)
set(CLANG_OFFLOAD_WRAPPER_LIB_DEPS
diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt
index c53485ef1957..01efebdcb929 100644
--- a/clang/tools/driver/CMakeLists.txt
+++ b/clang/tools/driver/CMakeLists.txt
@@ -24,10 +24,6 @@ if(CLANG_PLUGIN_SUPPORT)
set(support_plugins SUPPORT_PLUGINS)
endif()
-if(NOT CLANG_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_clang_tool(clang
driver.cpp
cc1_main.cpp
@@ -35,7 +31,7 @@ add_clang_tool(clang
cc1gen_reproducer_main.cpp
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
${support_plugins}
)
diff --git a/lld/COFF/CMakeLists.txt b/lld/COFF/CMakeLists.txt
index 4592ace373ef..796f7a82a3de 100644
--- a/lld/COFF/CMakeLists.txt
+++ b/lld/COFF/CMakeLists.txt
@@ -2,10 +2,6 @@ set(LLVM_TARGET_DEFINITIONS Options.td)
tablegen(LLVM Options.inc -gen-opt-parser-defs)
add_public_tablegen_target(COFFOptionsTableGen)
-if(NOT LLD_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_lld_library(lldCOFF
Chunks.cpp
DebugTypes.cpp
@@ -48,5 +44,5 @@ add_lld_library(lldCOFF
DEPENDS
COFFOptionsTableGen
- ${tablegen_deps}
+ intrinsics_gen
)
diff --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt
index 53649032bd98..212328b784c5 100644
--- a/lld/Common/CMakeLists.txt
+++ b/lld/Common/CMakeLists.txt
@@ -1,7 +1,3 @@
-if(NOT LLD_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc)
@@ -57,5 +53,5 @@ add_lld_library(lldCommon
${LLVM_PTHREAD_LIB}
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
)
diff --git a/lld/ELF/CMakeLists.txt b/lld/ELF/CMakeLists.txt
index b89f4436288a..f85d0fb9f55e 100644
--- a/lld/ELF/CMakeLists.txt
+++ b/lld/ELF/CMakeLists.txt
@@ -2,10 +2,6 @@ set(LLVM_TARGET_DEFINITIONS Options.td)
tablegen(LLVM Options.inc -gen-opt-parser-defs)
add_public_tablegen_target(ELFOptionsTableGen)
-if(NOT LLD_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_lld_library(lldELF
AArch64ErrataFix.cpp
Arch/AArch64.cpp
@@ -66,5 +62,5 @@ add_lld_library(lldELF
DEPENDS
ELFOptionsTableGen
- ${tablegen_deps}
+ intrinsics_gen
)
diff --git a/lld/MinGW/CMakeLists.txt b/lld/MinGW/CMakeLists.txt
index bb0fe4a3887d..1dc04d73eca6 100644
--- a/lld/MinGW/CMakeLists.txt
+++ b/lld/MinGW/CMakeLists.txt
@@ -2,10 +2,6 @@ set(LLVM_TARGET_DEFINITIONS Options.td)
tablegen(LLVM Options.inc -gen-opt-parser-defs)
add_public_tablegen_target(MinGWOptionsTableGen)
-if(NOT LLD_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_lld_library(lldMinGW
Driver.cpp
@@ -19,5 +15,5 @@ add_lld_library(lldMinGW
DEPENDS
MinGWOptionsTableGen
- ${tablegen_deps}
+ intrinsics_gen
)
diff --git a/lld/lib/Core/CMakeLists.txt b/lld/lib/Core/CMakeLists.txt
index 2d4d9ded0886..d5e507536b72 100644
--- a/lld/lib/Core/CMakeLists.txt
+++ b/lld/lib/Core/CMakeLists.txt
@@ -1,7 +1,3 @@
-if(NOT LLD_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_lld_library(lldCore
DefinedAtom.cpp
Error.cpp
@@ -24,5 +20,5 @@ add_lld_library(lldCore
${LLVM_PTHREAD_LIB}
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
)
diff --git a/lld/wasm/CMakeLists.txt b/lld/wasm/CMakeLists.txt
index d2ba862c1e4a..cd46f0a826ac 100644
--- a/lld/wasm/CMakeLists.txt
+++ b/lld/wasm/CMakeLists.txt
@@ -2,10 +2,6 @@ set(LLVM_TARGET_DEFINITIONS Options.td)
tablegen(LLVM Options.inc -gen-opt-parser-defs)
add_public_tablegen_target(WasmOptionsTableGen)
-if(NOT LLD_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_lld_library(lldWasm
Driver.cpp
InputChunks.cpp
@@ -37,5 +33,5 @@ add_lld_library(lldWasm
DEPENDS
WasmOptionsTableGen
- ${tablegen_deps}
+ intrinsics_gen
)
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index bf748020ea40..b1c0597cf3b3 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -64,7 +64,7 @@ endif ()
# some of these generated headers. This approach is copied from Clang's main
# CMakeLists.txt, so it should kept in sync the code in Clang which was added
# in llvm-svn 308844.
-if(LLVM_ENABLE_MODULES AND NOT LLDB_BUILT_STANDALONE)
+if(LLVM_ENABLE_MODULES)
list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
endif()
diff --git a/lldb/source/Expression/CMakeLists.txt b/lldb/source/Expression/CMakeLists.txt
index 7e2f19ed5b09..bf94361dd6c1 100644
--- a/lldb/source/Expression/CMakeLists.txt
+++ b/lldb/source/Expression/CMakeLists.txt
@@ -1,7 +1,3 @@
-if(NOT LLDB_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_lldb_library(lldbExpression
DiagnosticManager.cpp
DWARFExpression.cpp
@@ -18,7 +14,7 @@ add_lldb_library(lldbExpression
UtilityFunction.cpp
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
LINK_LIBS
lldbCore
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
index 69696b9aa76a..04f6cdf9d9bd 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -1,7 +1,3 @@
-if(NOT LLDB_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
add_lldb_library(lldbPluginExpressionParserClang
ASTResultSynthesizer.cpp
ASTStructExtractor.cpp
@@ -29,7 +25,7 @@ add_lldb_library(lldbPluginExpressionParserClang
NameSearchContext.cpp
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
LINK_LIBS
lldbCore
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
index c122e09e8feb..9efb2c44d846 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt
@@ -1,8 +1,3 @@
-if(NOT LLDB_BUILT_STANDALONE)
- set(tablegen_deps intrinsics_gen)
-endif()
-
-
add_lldb_library(lldbPluginRenderScriptRuntime PLUGIN
RenderScriptRuntime.cpp
RenderScriptExpressionOpts.cpp
@@ -10,7 +5,7 @@ add_lldb_library(lldbPluginRenderScriptRuntime PLUGIN
RenderScriptScriptGroup.cpp
DEPENDS
- ${tablegen_deps}
+ intrinsics_gen
LINK_LIBS
lldbBreakpoint
More information about the llvm-commits
mailing list