[llvm] 7d2c115 - [NFC] Add llvm-config.h def for LLVM_ENABLE_PLUGINS

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 15:57:07 PST 2022


Author: Mircea Trofin
Date: 2022-12-16T15:45:33-08:00
New Revision: 7d2c1150d31bb3692c81f6ecb0dbe61170e31212

URL: https://github.com/llvm/llvm-project/commit/7d2c1150d31bb3692c81f6ecb0dbe61170e31212
DIFF: https://github.com/llvm/llvm-project/commit/7d2c1150d31bb3692c81f6ecb0dbe61170e31212.diff

LOG: [NFC] Add llvm-config.h def for LLVM_ENABLE_PLUGINS

Snatched from D139644, but because it'd also need a fix in
Passes/CMakeLists.txt, decided to peel it off.

Added: 
    

Modified: 
    llvm/include/llvm/Config/llvm-config.h.cmake
    llvm/unittests/Passes/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Config/llvm-config.h.cmake b/llvm/include/llvm/Config/llvm-config.h.cmake
index b997c1d2b2bba..012ae2174cc2a 100644
--- a/llvm/include/llvm/Config/llvm-config.h.cmake
+++ b/llvm/include/llvm/Config/llvm-config.h.cmake
@@ -123,4 +123,7 @@
 /* Define to 1 if you have the DIA SDK installed, and to 0 if you don't. */
 #cmakedefine01 LLVM_ENABLE_DIA_SDK
 
+/* Define if plugins enabled */
+#cmakedefine LLVM_ENABLE_PLUGINS
+
 #endif

diff  --git a/llvm/unittests/Passes/CMakeLists.txt b/llvm/unittests/Passes/CMakeLists.txt
index a5683cd3741f5..54bf67b39c1e7 100644
--- a/llvm/unittests/Passes/CMakeLists.txt
+++ b/llvm/unittests/Passes/CMakeLists.txt
@@ -1,12 +1,6 @@
 # Needed by LLVM's CMake checks because this file defines multiple targets.
 set(LLVM_OPTIONAL_SOURCES PluginsTest.cpp TestPlugin.cpp DoublerPlugin.cpp PassBuilderBindingsTest.cpp)
 
-# If plugins are disabled, this test will disable itself at runtime. Otherwise,
-# reconfiguring with plugins disabled will leave behind a stale executable.
-if (LLVM_ENABLE_PLUGINS)
-  add_definitions(-DLLVM_ENABLE_PLUGINS)
-endif()
-
 # The plugin expects to not link against the Support and Core libraries,
 # but expects them to exist in the process loading the plugin. This doesn't
 # work with DLLs on Windows (where a shared library can't have undefined


        


More information about the llvm-commits mailing list