diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2009-11-10 02:45:37 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2009-11-10 02:45:37 +0000 |
commit | c5e1ae13132ee1df5b4d32818246d641cbc8a129 (patch) | |
tree | 722566bf2bcd7c4a6d5da7309366ea4c1ffe612f /cmake/modules/AddLLVM.cmake | |
parent | 6f479e597c3c9e7e4d8a2e1340f6285fb54b27f3 (diff) |
CMake: Support for building llvm loadable modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/AddLLVM.cmake')
-rwxr-xr-x | cmake/modules/AddLLVM.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 205ddb7663..cb71b7e960 100755 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -22,6 +22,22 @@ macro(add_llvm_library name) endmacro(add_llvm_library name) +macro(add_llvm_loadable_module name) + if( NOT LLVM_ON_UNIX ) + message(STATUS "Loadable modules not supported on this platform. +${name} ignored.") + else() + set(BUILD_SHARED_LIBS ON) + llvm_process_sources( ALL_FILES ${ARGN} ) + add_library( ${name} MODULE ${ALL_FILES} ) + set_target_properties( ${name} PROPERTIES PREFIX "" ) + install(TARGETS ${name} + LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} + ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) + endif() +endmacro(add_llvm_loadable_module name) + + macro(add_llvm_executable name) llvm_process_sources( ALL_FILES ${ARGN} ) add_executable(${name} ${ALL_FILES}) |