[llvm] r362328 - [test] Fix plugin tests
Don Hinton via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 2 08:53:43 PDT 2019
Author: dhinton
Date: Sun Jun 2 08:53:43 2019
New Revision: 362328
URL: http://llvm.org/viewvc/llvm-project?rev=362328&view=rev
Log:
[test] Fix plugin tests
Recommit of r361790 that was temporarily reverted in r361793 due to bot breakage.
Summary:
The following changes were required to fix these tests:
1) Change LLVM_ENABLE_PLUGINS to an option and move it to
llvm/CMakeLists.txt with an appropriate default -- which matches
the original default behavior.
2) Move the plugins directory from clang/test/Analysis
clang/lib/Analysis. It's not enough to add an exclude to the
lit.local.cfg file because add_lit_testsuites recurses the tree and
automatically adds the appropriate `check-` targets, which don't
make sense for the plugins because they aren't tests and don't
have `RUN` statements.
Here's a list of the `clang-check-anlysis*` targets with this
change:
```
$ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
check-clang-analysis
check-clang-analysis-checkers
check-clang-analysis-copypaste
check-clang-analysis-diagnostics
check-clang-analysis-engine
check-clang-analysis-exploration_order
check-clang-analysis-html_diagnostics
check-clang-analysis-html_diagnostics-relevant_lines
check-clang-analysis-inlining
check-clang-analysis-objc
check-clang-analysis-unified-sources
check-clang-analysis-z3
```
3) Simplify the logic and only include the subdirectories under
clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.
Reviewed By: NoQ
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D62445
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=362328&r1=362327&r2=362328&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Sun Jun 2 08:53:43 2019
@@ -622,6 +622,17 @@ set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET
message(STATUS "LLVM host triple: ${LLVM_HOST_TRIPLE}")
message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")
+if(WIN32 OR CYGWIN)
+ if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
+ set(LLVM_ENABLE_PLUGINS_default ON)
+ else()
+ set(LLVM_ENABLE_PLUGINS_default OFF)
+ endif()
+else()
+ set(LLVM_ENABLE_PLUGINS_default ON)
+endif()
+option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default})
+
include(HandleLLVMOptions)
# Verify that we can find a Python 2 interpreter. Python 3 is unsupported.
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=362328&r1=362327&r2=362328&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Sun Jun 2 08:53:43 2019
@@ -912,14 +912,6 @@ if(LLVM_LINK_LLVM_DYLIB AND LLVM_EXPORT_
message(FATAL_ERROR "LLVM_LINK_LLVM_DYLIB not compatible with LLVM_EXPORT_SYMBOLS_FOR_PLUGINS")
endif()
-# Plugin support
-# FIXME: Make this configurable.
-if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
- set(LLVM_ENABLE_PLUGINS ON)
-else()
- set(LLVM_ENABLE_PLUGINS OFF)
-endif()
-
# By default we should enable LLVM_ENABLE_IDE only for multi-configuration
# generators. This option disables optional build system features that make IDEs
# less usable.
More information about the llvm-commits
mailing list