From ee281f26a416d9d293621ed8a9a114a2c0e312f1 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Wed, 16 Feb 2022 16:31:51 -0800
Subject: [PATCH] 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 7d8a2d0..b454832 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -481,15 +481,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 157be7e..ffd95e2 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 9e8fa9c..58cb58b 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -7,11 +7,11 @@ llvm_canonicalize_cmake_booleans(
CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL
CLANG_ENABLE_ARCMT
CLANG_ENABLE_STATIC_ANALYZER
- CLANG_PLUGIN_SUPPORT
CLANG_SPAWN_CC1
ENABLE_BACKTRACES
LLVM_ENABLE_ZLIB
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
+ LLVM_ENABLE_PLUGINS
LLVM_ENABLE_THREADS
LLVM_WITH_Z3
)
@@ -137,7 +137,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 8a9849f..5dc3bfa 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 6b3e159..52d439c 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)
--
1.8.3.1