From 7ca91f97cc0e671b8f267a63c4d55c3b35c1cab8 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 4 Jul 2014 04:45:40 +0000 Subject: [PATCH] [CMake] Introduce LLVM_ENABLE_PLUGINS as an internal option. BUILD_SHARED_LIBS may not control enable/disable plugins. FIXME: Make this configurable. FIXME: "ENABLE_SHARED" doesn't make sense, since it is used just for plugins. We may rename it. I introduced config.enable_shared in r120273. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212315 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/AddLLVM.cmake | 16 ++++++++-------- cmake/modules/HandleLLVMOptions.cmake | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 1b8fa0eac07..31540d96d31 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -210,7 +210,7 @@ function(llvm_add_library name) if(ARG_SHARED OR ARG_STATIC) message(WARNING "MODULE with SHARED|STATIC doesn't make sense.") endif() - if(NOT LLVM_ON_UNIX OR CYGWIN) + if(NOT LLVM_ENABLE_PLUGINS) message(STATUS "${name} ignored -- Loadable modules not supported on this platform.") return() endif() @@ -575,12 +575,6 @@ function(configure_lit_site_cfg input output) set(SHLIBEXT "${LTDL_SHLIB_EXT}") - if(BUILD_SHARED_LIBS) - set(LLVM_SHARED_LIBS_ENABLED "1") - else() - set(LLVM_SHARED_LIBS_ENABLED "0") - endif(BUILD_SHARED_LIBS) - # Configuration-time: See Unit/lit.site.cfg.in if (CMAKE_CFG_INTDIR STREQUAL ".") set(LLVM_BUILD_MODE ".") @@ -598,7 +592,13 @@ function(configure_lit_site_cfg input output) string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} SHLIBDIR "${LLVM_SHLIB_OUTPUT_INTDIR}") set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) - set(ENABLE_SHARED ${LLVM_SHARED_LIBS_ENABLED}) + # FIXME: "ENABLE_SHARED" doesn't make sense, since it is used just for + # plugins. We may rename it. + if(LLVM_ENABLE_PLUGINS) + set(ENABLE_SHARED "1") + else() + set(ENABLE_SHARED "0") + endif() if(LLVM_ENABLE_ASSERTIONS AND NOT MSVC_IDE) set(ENABLE_ASSERTIONS "1") diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 201c2b62540..d809077141b 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -413,3 +413,12 @@ if(MSVC) string(REGEX REPLACE "(^| ) */EH[-cs]+ *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REGEX REPLACE "(^| ) */GR-? *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() + +# Plugin support +# FIXME: Make this configurable. +if(WIN32 OR CYGWIN) + # DLL platform(s) don't support plugins. + set(LLVM_ENABLE_PLUGINS OFF) +else() + set(LLVM_ENABLE_PLUGINS ON) +endif()