forked from OSchip/llvm-project
[NFC] Add SUPPORT_PLUGINS to add_llvm_executable()
Summary: this allows us to move logic about when it is appropriate set LLVM_NO_DEAD_STRIP out of each tool and into add_llvm_executable, which will enable future platform specific handling. This is a follow on to the reverted D69356 Reviewers: hubert.reinterpretcast, beanz, lhames Reviewed By: beanz Subscribers: mgorny, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69638
This commit is contained in:
parent
52af7aedfe
commit
6740a88dc1
|
@ -19,10 +19,9 @@ set( LLVM_LINK_COMPONENTS
|
||||||
|
|
||||||
option(CLANG_PLUGIN_SUPPORT "Build clang with plugin support" ON)
|
option(CLANG_PLUGIN_SUPPORT "Build clang with plugin support" ON)
|
||||||
|
|
||||||
# Support plugins. This must be before add_clang_executable as it reads
|
# Support plugins.
|
||||||
# LLVM_NO_DEAD_STRIP.
|
|
||||||
if(CLANG_PLUGIN_SUPPORT)
|
if(CLANG_PLUGIN_SUPPORT)
|
||||||
set(LLVM_NO_DEAD_STRIP 1)
|
set(support_plugins SUPPORT_PLUGINS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CLANG_BUILT_STANDALONE)
|
if(NOT CLANG_BUILT_STANDALONE)
|
||||||
|
@ -37,6 +36,7 @@ add_clang_tool(clang
|
||||||
|
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${tablegen_deps}
|
${tablegen_deps}
|
||||||
|
${support_plugins}
|
||||||
)
|
)
|
||||||
|
|
||||||
clang_target_link_libraries(clang
|
clang_target_link_libraries(clang
|
||||||
|
|
|
@ -732,7 +732,7 @@ endmacro(add_llvm_library name)
|
||||||
|
|
||||||
macro(add_llvm_executable name)
|
macro(add_llvm_executable name)
|
||||||
cmake_parse_arguments(ARG
|
cmake_parse_arguments(ARG
|
||||||
"DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH"
|
"DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH;SUPPORT_PLUGINS"
|
||||||
"ENTITLEMENTS;BUNDLE_PATH"
|
"ENTITLEMENTS;BUNDLE_PATH"
|
||||||
"DEPENDS"
|
"DEPENDS"
|
||||||
${ARGN})
|
${ARGN})
|
||||||
|
@ -782,6 +782,11 @@ macro(add_llvm_executable name)
|
||||||
if(NOT LLVM_ENABLE_OBJLIB)
|
if(NOT LLVM_ENABLE_OBJLIB)
|
||||||
llvm_update_compile_flags(${name})
|
llvm_update_compile_flags(${name})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (ARG_SUPPORT_PLUGINS)
|
||||||
|
set(LLVM_NO_DEAD_STRIP On)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_link_opts( ${name} )
|
add_link_opts( ${name} )
|
||||||
|
|
||||||
# Do not add -Dname_EXPORTS to the command-line when building files in this
|
# Do not add -Dname_EXPORTS to the command-line when building files in this
|
||||||
|
|
|
@ -21,9 +21,6 @@ set(LLVM_LINK_COMPONENTS
|
||||||
Vectorize
|
Vectorize
|
||||||
)
|
)
|
||||||
|
|
||||||
# Support plugins.
|
|
||||||
set(LLVM_NO_DEAD_STRIP 1)
|
|
||||||
|
|
||||||
add_llvm_tool(bugpoint
|
add_llvm_tool(bugpoint
|
||||||
BugDriver.cpp
|
BugDriver.cpp
|
||||||
CrashDebugger.cpp
|
CrashDebugger.cpp
|
||||||
|
@ -37,6 +34,7 @@ add_llvm_tool(bugpoint
|
||||||
|
|
||||||
DEPENDS
|
DEPENDS
|
||||||
intrinsics_gen
|
intrinsics_gen
|
||||||
|
SUPPORT_PLUGINS
|
||||||
)
|
)
|
||||||
export_executable_symbols(bugpoint)
|
export_executable_symbols(bugpoint)
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,11 @@ set(LLVM_LINK_COMPONENTS
|
||||||
Vectorize
|
Vectorize
|
||||||
)
|
)
|
||||||
|
|
||||||
# Support plugins.
|
|
||||||
set(LLVM_NO_DEAD_STRIP 1)
|
|
||||||
|
|
||||||
add_llvm_tool(llc
|
add_llvm_tool(llc
|
||||||
llc.cpp
|
llc.cpp
|
||||||
|
|
||||||
DEPENDS
|
DEPENDS
|
||||||
intrinsics_gen
|
intrinsics_gen
|
||||||
|
SUPPORT_PLUGINS
|
||||||
)
|
)
|
||||||
export_executable_symbols(llc)
|
export_executable_symbols(llc)
|
||||||
|
|
|
@ -24,9 +24,6 @@ set(LLVM_LINK_COMPONENTS
|
||||||
Passes
|
Passes
|
||||||
)
|
)
|
||||||
|
|
||||||
# Support plugins.
|
|
||||||
set(LLVM_NO_DEAD_STRIP 1)
|
|
||||||
|
|
||||||
add_llvm_tool(opt
|
add_llvm_tool(opt
|
||||||
AnalysisWrappers.cpp
|
AnalysisWrappers.cpp
|
||||||
BreakpointPrinter.cpp
|
BreakpointPrinter.cpp
|
||||||
|
@ -39,6 +36,7 @@ add_llvm_tool(opt
|
||||||
|
|
||||||
DEPENDS
|
DEPENDS
|
||||||
intrinsics_gen
|
intrinsics_gen
|
||||||
|
SUPPORT_PLUGINS
|
||||||
)
|
)
|
||||||
export_executable_symbols(opt)
|
export_executable_symbols(opt)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue