Skip to content

Commit

Permalink
[CMake] Make intrinsics_gen dependency unconditional.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michele-scandale authored and MaskRay committed Jul 17, 2020
1 parent 63c081e commit 53880b8
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 91 deletions.
2 changes: 1 addition & 1 deletion clang/CMakeLists.txt
Expand Up @@ -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()

Expand Down
11 changes: 1 addition & 10 deletions clang/lib/CodeGen/CMakeLists.txt
Expand Up @@ -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()
Expand Down Expand Up @@ -99,7 +90,7 @@ add_clang_library(clangCodeGen
VarBypassDetector.cpp

DEPENDS
${codegen_deps}
intrinsics_gen

LINK_LIBS
clangAnalysis
Expand Down
7 changes: 1 addition & 6 deletions clang/lib/Frontend/CMakeLists.txt
Expand Up @@ -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
Expand Down Expand Up @@ -49,7 +44,7 @@ add_clang_library(clangFrontend

DEPENDS
ClangDriverOptions
${optional_deps}
intrinsics_gen

LINK_LIBS
clangAST
Expand Down
8 changes: 1 addition & 7 deletions clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
Expand Up @@ -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
)
6 changes: 1 addition & 5 deletions clang/tools/clang-import-test/CMakeLists.txt
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions 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
Expand Down
6 changes: 1 addition & 5 deletions 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
Expand Down
6 changes: 1 addition & 5 deletions clang/tools/driver/CMakeLists.txt
Expand Up @@ -24,18 +24,14 @@ 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
cc1as_main.cpp
cc1gen_reproducer_main.cpp

DEPENDS
${tablegen_deps}
intrinsics_gen
${support_plugins}
)

Expand Down
6 changes: 1 addition & 5 deletions lld/COFF/CMakeLists.txt
Expand Up @@ -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
Expand Down Expand Up @@ -48,5 +44,5 @@ add_lld_library(lldCOFF

DEPENDS
COFFOptionsTableGen
${tablegen_deps}
intrinsics_gen
)
6 changes: 1 addition & 5 deletions 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)

Expand Down Expand Up @@ -57,5 +53,5 @@ add_lld_library(lldCommon
${LLVM_PTHREAD_LIB}

DEPENDS
${tablegen_deps}
intrinsics_gen
)
6 changes: 1 addition & 5 deletions lld/ELF/CMakeLists.txt
Expand Up @@ -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
Expand Down Expand Up @@ -66,5 +62,5 @@ add_lld_library(lldELF

DEPENDS
ELFOptionsTableGen
${tablegen_deps}
intrinsics_gen
)
6 changes: 1 addition & 5 deletions lld/MinGW/CMakeLists.txt
Expand Up @@ -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

Expand All @@ -19,5 +15,5 @@ add_lld_library(lldMinGW

DEPENDS
MinGWOptionsTableGen
${tablegen_deps}
intrinsics_gen
)
6 changes: 1 addition & 5 deletions 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
Expand All @@ -24,5 +20,5 @@ add_lld_library(lldCore
${LLVM_PTHREAD_LIB}

DEPENDS
${tablegen_deps}
intrinsics_gen
)
6 changes: 1 addition & 5 deletions lld/wasm/CMakeLists.txt
Expand Up @@ -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
Expand Down Expand Up @@ -37,5 +33,5 @@ add_lld_library(lldWasm

DEPENDS
WasmOptionsTableGen
${tablegen_deps}
intrinsics_gen
)
2 changes: 1 addition & 1 deletion lldb/CMakeLists.txt
Expand Up @@ -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()

Expand Down
6 changes: 1 addition & 5 deletions 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
Expand All @@ -18,7 +14,7 @@ add_lldb_library(lldbExpression
UtilityFunction.cpp

DEPENDS
${tablegen_deps}
intrinsics_gen

LINK_LIBS
lldbCore
Expand Down
6 changes: 1 addition & 5 deletions 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
Expand Down Expand Up @@ -29,7 +25,7 @@ add_lldb_library(lldbPluginExpressionParserClang
NameSearchContext.cpp

DEPENDS
${tablegen_deps}
intrinsics_gen

LINK_LIBS
lldbCore
Expand Down
@@ -1,16 +1,11 @@
if(NOT LLDB_BUILT_STANDALONE)
set(tablegen_deps intrinsics_gen)
endif()


add_lldb_library(lldbPluginRenderScriptRuntime PLUGIN
RenderScriptRuntime.cpp
RenderScriptExpressionOpts.cpp
RenderScriptx86ABIFixups.cpp
RenderScriptScriptGroup.cpp

DEPENDS
${tablegen_deps}
intrinsics_gen

LINK_LIBS
lldbBreakpoint
Expand Down

0 comments on commit 53880b8

Please sign in to comment.