summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-08 11:10:24 +0000
committerAlp Toker <alp@nuanti.com>2014-01-08 11:10:24 +0000
commitb1adf0890a1c19b2fd32a525c7c99e9db6da493f (patch)
tree9f1853e1702aa01c31b084b8173908fee77d1262
parent958cc01fffc3df2776d24dc045c80f488ae3ba79 (diff)
downloadllvm-b1adf0890a1c19b2fd32a525c7c99e9db6da493f.tar.gz
llvm-b1adf0890a1c19b2fd32a525c7c99e9db6da493f.tar.bz2
llvm-b1adf0890a1c19b2fd32a525c7c99e9db6da493f.tar.xz
CMake: Provide LLVM_PLUGIN_EXT definition
This is needed to support the addition of tests for clang loadable plugins. In clang, plugins are built as modules (bundles on OS X) rather than dynamic libraries (dylib) so the build system needs to inform lit of the actual file extension in use, typically '.so' on Unix and '.dll' on Windows. (LLVM itself should probably switch to this scheme to fix PR14903 once and for all.) No change in build output or functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198746 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/modules/AddLLVM.cmake4
-rw-r--r--cmake/modules/HandleLLVMOptions.cmake9
2 files changed, 8 insertions, 5 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 83422fb18f..de00ab46ae 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -215,6 +215,10 @@ ${name} ignored.")
LINK_FLAGS " -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
endif()
+ if (MODULE)
+ set_property(TARGET ${name} PROPERTY SUFFIX ${LLVM_PLUGIN_EXT})
+ endif ()
+
if( EXCLUDE_FROM_ALL )
set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
else()
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 21d2cd6740..f19d10dd16 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -49,8 +49,6 @@ if(WIN32)
set(LLVM_ON_WIN32 1)
set(LLVM_ON_UNIX 0)
endif(CYGWIN)
- set(LTDL_SHLIB_EXT ".dll")
- set(EXEEXT ".exe")
# Maximum path length is 160 for non-unicode paths
set(MAXPATHLEN 160)
else(WIN32)
@@ -59,12 +57,9 @@ else(WIN32)
set(LLVM_ON_UNIX 1)
if(APPLE)
set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
- set(LTDL_SHLIB_EXT ".dylib")
else(APPLE)
set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
- set(LTDL_SHLIB_EXT ".so")
endif(APPLE)
- set(EXEEXT "")
# FIXME: Maximum path length is currently set to 'safe' fixed value
set(MAXPATHLEN 2024)
else(UNIX)
@@ -72,6 +67,10 @@ else(WIN32)
endif(UNIX)
endif(WIN32)
+set(EXEEXT ${CMAKE_EXECUTABLE_SUFFIX})
+set(LTDL_SHLIB_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})
+set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_MODULE_SUFFIX})
+
function(add_flag_or_print_warning flag)
check_c_compiler_flag(${flag} C_SUPPORTS_FLAG)
check_cxx_compiler_flag(${flag} CXX_SUPPORTS_FLAG)