[clang] 6740a88 - [NFC] Add SUPPORT_PLUGINS to add_llvm_executable()
David Tenty via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 6 11:33:11 PST 2019
Author: David Tenty
Date: 2019-11-06T14:32:35-05:00
New Revision: 6740a88dc18d0be14926a5e709bd5062e31ee81c
URL: https://github.com/llvm/llvm-project/commit/6740a88dc18d0be14926a5e709bd5062e31ee81c
DIFF: https://github.com/llvm/llvm-project/commit/6740a88dc18d0be14926a5e709bd5062e31ee81c.diff
LOG: [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
Added:
Modified:
clang/tools/driver/CMakeLists.txt
llvm/cmake/modules/AddLLVM.cmake
llvm/tools/bugpoint/CMakeLists.txt
llvm/tools/llc/CMakeLists.txt
llvm/tools/opt/CMakeLists.txt
Removed:
################################################################################
diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt
index 590d708d837c..52a95e6bc6b1 100644
--- a/clang/tools/driver/CMakeLists.txt
+++ b/clang/tools/driver/CMakeLists.txt
@@ -19,10 +19,9 @@ set( LLVM_LINK_COMPONENTS
option(CLANG_PLUGIN_SUPPORT "Build clang with plugin support" ON)
-# Support plugins. This must be before add_clang_executable as it reads
-# LLVM_NO_DEAD_STRIP.
+# Support plugins.
if(CLANG_PLUGIN_SUPPORT)
- set(LLVM_NO_DEAD_STRIP 1)
+ set(support_plugins SUPPORT_PLUGINS)
endif()
if(NOT CLANG_BUILT_STANDALONE)
@@ -37,6 +36,7 @@ add_clang_tool(clang
DEPENDS
${tablegen_deps}
+ ${support_plugins}
)
clang_target_link_libraries(clang
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 63f6fc7bf5d1..0508b621622b 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -732,7 +732,7 @@ endmacro(add_llvm_library name)
macro(add_llvm_executable name)
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"
"DEPENDS"
${ARGN})
@@ -782,6 +782,11 @@ macro(add_llvm_executable name)
if(NOT LLVM_ENABLE_OBJLIB)
llvm_update_compile_flags(${name})
endif()
+
+ if (ARG_SUPPORT_PLUGINS)
+ set(LLVM_NO_DEAD_STRIP On)
+ endif()
+
add_link_opts( ${name} )
# Do not add -Dname_EXPORTS to the command-line when building files in this
diff --git a/llvm/tools/bugpoint/CMakeLists.txt b/llvm/tools/bugpoint/CMakeLists.txt
index 031f51480cce..c1ef9173928c 100644
--- a/llvm/tools/bugpoint/CMakeLists.txt
+++ b/llvm/tools/bugpoint/CMakeLists.txt
@@ -21,9 +21,6 @@ set(LLVM_LINK_COMPONENTS
Vectorize
)
-# Support plugins.
-set(LLVM_NO_DEAD_STRIP 1)
-
add_llvm_tool(bugpoint
BugDriver.cpp
CrashDebugger.cpp
@@ -37,6 +34,7 @@ add_llvm_tool(bugpoint
DEPENDS
intrinsics_gen
+ SUPPORT_PLUGINS
)
export_executable_symbols(bugpoint)
diff --git a/llvm/tools/llc/CMakeLists.txt b/llvm/tools/llc/CMakeLists.txt
index 300efdab10d0..880deefa539c 100644
--- a/llvm/tools/llc/CMakeLists.txt
+++ b/llvm/tools/llc/CMakeLists.txt
@@ -19,13 +19,11 @@ set(LLVM_LINK_COMPONENTS
Vectorize
)
-# Support plugins.
-set(LLVM_NO_DEAD_STRIP 1)
-
add_llvm_tool(llc
llc.cpp
DEPENDS
intrinsics_gen
+ SUPPORT_PLUGINS
)
export_executable_symbols(llc)
diff --git a/llvm/tools/opt/CMakeLists.txt b/llvm/tools/opt/CMakeLists.txt
index cb4ba5cfbced..25a4ebba6992 100644
--- a/llvm/tools/opt/CMakeLists.txt
+++ b/llvm/tools/opt/CMakeLists.txt
@@ -24,9 +24,6 @@ set(LLVM_LINK_COMPONENTS
Passes
)
-# Support plugins.
-set(LLVM_NO_DEAD_STRIP 1)
-
add_llvm_tool(opt
AnalysisWrappers.cpp
BreakpointPrinter.cpp
@@ -39,6 +36,7 @@ add_llvm_tool(opt
DEPENDS
intrinsics_gen
+ SUPPORT_PLUGINS
)
export_executable_symbols(opt)
More information about the cfe-commits
mailing list