[PATCH] D62174: [Analysis] Link library dependencies to Analysis plugins
Petr Hosek via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 20 22:53:52 PDT 2019
phosek created this revision.
phosek added reviewers: hintonda, vitalybuka, Szelethus.
Herald added subscribers: llvm-commits, cfe-commits, mgorny.
Herald added projects: clang, LLVM.
These are needed to avoid undefined symbols which aren't satisfied
by Clang itself.
Repository:
rC Clang
https://reviews.llvm.org/D62174
Files:
clang/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
clang/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
clang/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
llvm/cmake/modules/HandleLLVMOptions.cmake
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -920,10 +920,14 @@
# Plugin support
# FIXME: Make this configurable.
-if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
- set(LLVM_ENABLE_PLUGINS ON)
+if(WIN32 OR CYGWIN)
+ if(BUILD_SHARED_LIBS OR LLVM_BUILD_LLVM_DYLIB)
+ set(LLVM_ENABLE_PLUGINS ON)
+ else()
+ set(LLVM_ENABLE_PLUGINS OFF)
+ endif()
else()
- set(LLVM_ENABLE_PLUGINS OFF)
+ set(LLVM_ENABLE_PLUGINS ON)
endif()
# By default we should enable LLVM_ENABLE_IDE only for multi-configuration
Index: clang/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
===================================================================
--- clang/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
+++ clang/test/Analysis/plugins/SampleAnalyzer/CMakeLists.txt
@@ -1,11 +1,12 @@
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/SampleAnalyzerPlugin.exports)
add_llvm_library(SampleAnalyzerPlugin MODULE MainCallChecker.cpp PLUGIN_TOOL clang)
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
target_link_libraries(SampleAnalyzerPlugin PRIVATE
clangAnalysis
clangAST
clangStaticAnalyzerCore
+ clangStaticAnalyzerFrontend
LLVMSupport
)
endif()
Index: clang/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
===================================================================
--- clang/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
+++ clang/test/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt
@@ -1,11 +1,12 @@
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CheckerOptionHandlingAnalyzerPlugin.exports)
add_llvm_library(CheckerOptionHandlingAnalyzerPlugin MODULE CheckerOptionHandling.cpp PLUGIN_TOOL clang)
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
target_link_libraries(CheckerOptionHandlingAnalyzerPlugin PRIVATE
clangAnalysis
clangAST
clangStaticAnalyzerCore
+ clangStaticAnalyzerFrontend
LLVMSupport
)
endif()
Index: clang/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
===================================================================
--- clang/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
+++ clang/test/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt
@@ -1,11 +1,12 @@
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CheckerDependencyHandlingAnalyzerPlugin.exports)
add_llvm_library(CheckerDependencyHandlingAnalyzerPlugin MODULE CheckerDependencyHandling.cpp PLUGIN_TOOL clang)
-if(LLVM_ENABLE_PLUGINS AND (WIN32 OR CYGWIN))
+if(LLVM_ENABLE_PLUGINS)
target_link_libraries(CheckerDependencyHandlingAnalyzerPlugin PRIVATE
clangAnalysis
clangAST
clangStaticAnalyzerCore
+ clangStaticAnalyzerFrontend
LLVMSupport
)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62174.200405.patch
Type: text/x-patch
Size: 2971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190521/c99e39ac/attachment.bin>
More information about the cfe-commits
mailing list