From 8df7f933aedc1319e2c6681641dc8f50d3e8ad25 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Wed, 16 Feb 2022 16:31:51 -0800
Subject: Revert "replace clang LLVM_ENABLE_PLUGINS -> CLANG_PLUGIN_SUPPORT in
tests"
This reverts commit 76cad51ba700233d6e3492eddcbb466b6adbc2eb.
We don't install the LLVMHello plugin, so tests should not depend on it.
---
clang/CMakeLists.txt | 9 ---------
clang/lib/Analysis/plugins/CMakeLists.txt | 2 +-
clang/test/CMakeLists.txt | 4 ++--
clang/test/lit.site.cfg.py.in | 2 +-
clang/tools/driver/CMakeLists.txt | 2 ++
5 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 9a304db5a2c6..be0d82117aab 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -470,15 +470,6 @@ add_definitions( -D_GNU_SOURCE )
option(CLANG_BUILD_TOOLS
"Build the Clang tools. If OFF, just generate build targets." ON)
-if(LLVM_ENABLE_PLUGINS OR LLVM_EXPORT_SYMBOLS_FOR_PLUGINS)
- set(HAVE_CLANG_PLUGIN_SUPPORT ON)
-else()
- set(HAVE_CLANG_PLUGIN_SUPPORT OFF)
-endif()
-CMAKE_DEPENDENT_OPTION(CLANG_PLUGIN_SUPPORT
- "Build clang with plugin support" ON
- "HAVE_CLANG_PLUGIN_SUPPORT" OFF)
-
option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
option(CLANG_ENABLE_STATIC_ANALYZER
"Include static analyzer in clang binary." ON)
diff --git a/clang/lib/Analysis/plugins/CMakeLists.txt b/clang/lib/Analysis/plugins/CMakeLists.txt
index 157be7e4147b..ffd95e2886bf 100644
--- a/clang/lib/Analysis/plugins/CMakeLists.txt
+++ b/clang/lib/Analysis/plugins/CMakeLists.txt
@@ -1,7 +1,7 @@
# Since these do not specify a specific PLUGIN_TOOL (which could be clang or
# clang-tidy), we cannot compile this unless the platform supports plugins with
# undefined symbols, and cannot use it unless the user has opted for clang plugins).
-if(CLANG_ENABLE_STATIC_ANALYZER AND CLANG_PLUGIN_SUPPORT AND LLVM_ENABLE_PLUGINS)
+if(CLANG_ENABLE_STATIC_ANALYZER AND LLVM_ENABLE_PLUGINS)
add_subdirectory(SampleAnalyzer)
add_subdirectory(CheckerDependencyHandling)
add_subdirectory(CheckerOptionHandling)
diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index 15b38478ded3..4f930d54bc70 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -14,12 +14,12 @@ llvm_canonicalize_cmake_booleans(
CLANG_DEFAULT_PIE_ON_LINUX
CLANG_ENABLE_ARCMT
CLANG_ENABLE_STATIC_ANALYZER
- CLANG_PLUGIN_SUPPORT
CLANG_SPAWN_CC1
ENABLE_BACKTRACES
LLVM_ENABLE_NEW_PASS_MANAGER
LLVM_ENABLE_ZLIB
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
+ LLVM_ENABLE_PLUGINS
LLVM_ENABLE_THREADS
LLVM_WITH_Z3
)
@@ -146,7 +146,7 @@ if( NOT CLANG_BUILT_STANDALONE )
endif()
if(CLANG_ENABLE_STATIC_ANALYZER)
- if(CLANG_PLUGIN_SUPPORT AND LLVM_ENABLE_PLUGINS) # Determine if we built them
+ if(LLVM_ENABLE_PLUGINS) # Determine if we built them
list(APPEND CLANG_TEST_DEPS
SampleAnalyzerPlugin
CheckerDependencyHandlingAnalyzerPlugin
diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 1e2e331d54db..bc3022d2bee9 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -34,7 +34,7 @@ config.enable_threads = @LLVM_ENABLE_THREADS@
config.host_arch = "@HOST_ARCH@"
config.python_executable = "@Python3_EXECUTABLE@"
config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
-config.has_plugins = @CLANG_PLUGIN_SUPPORT@
+config.has_plugins = @LLVM_ENABLE_PLUGINS@
config.clang_vendor_uti = "@CLANG_VENDOR_UTI@"
config.llvm_external_lit = path(r"@LLVM_EXTERNAL_LIT@")
diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt
index 6b3e159d1b64..52d439ce6a3b 100644
--- a/clang/tools/driver/CMakeLists.txt
+++ b/clang/tools/driver/CMakeLists.txt
@@ -17,6 +17,8 @@ set( LLVM_LINK_COMPONENTS
Vectorize
)
+option(CLANG_PLUGIN_SUPPORT "Build clang with plugin support" ON)
+
# Support plugins.
if(CLANG_PLUGIN_SUPPORT)
set(support_plugins SUPPORT_PLUGINS)
--
2.34.1