[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
This commit is contained in:
NAKAMURA Takumi 2014-07-04 04:45:40 +00:00
parent 1f8525a98f
commit 7ca91f97cc
2 changed files with 17 additions and 8 deletions

View File

@ -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")

View File

@ -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()