summaryrefslogtreecommitdiffstats
path: root/cmake/modules/AddLLVM.cmake
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-10-20 21:10:27 +0000
committerdim <dim@FreeBSD.org>2011-10-20 21:10:27 +0000
commit7b3392326c40c3c20697816acae597ba7b3144eb (patch)
tree2cbcf22585e99f8a87d12d5ff94f392c0d266819 /cmake/modules/AddLLVM.cmake
parent1176aa52646fe641a4243a246aa7f960c708a274 (diff)
downloadFreeBSD-src-7b3392326c40c3c20697816acae597ba7b3144eb.zip
FreeBSD-src-7b3392326c40c3c20697816acae597ba7b3144eb.tar.gz
Vendor import of llvm release_30 branch r142614:
http://llvm.org/svn/llvm-project/llvm/branches/release_30@142614
Diffstat (limited to 'cmake/modules/AddLLVM.cmake')
-rwxr-xr-xcmake/modules/AddLLVM.cmake28
1 files changed, 11 insertions, 17 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index c13143b..b486fe4 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -24,16 +24,17 @@ macro(add_llvm_library name)
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endif()
- # The LLVM Target library shall be built before its sublibraries
- # (asmprinter, etc) because those may use tablegenned files which
- # generation is triggered by the main LLVM target library. Necessary
- # for parallel builds:
- if( CURRENT_LLVM_TARGET )
- add_dependencies(${name} ${CURRENT_LLVM_TARGET})
- endif()
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
endmacro(add_llvm_library name)
+macro(add_llvm_library_dependencies name)
+ # Save the dependencies of the LLVM library in a variable so that we can
+ # query it when resolve llvm-config-style component -> library mappings.
+ set_property(GLOBAL PROPERTY LLVM_LIB_DEPS_${name} ${ARGN})
+
+ # Then add the actual dependencies to the library target.
+ target_link_libraries(${name} ${ARGN})
+endmacro(add_llvm_library_dependencies name)
macro(add_llvm_loadable_module name)
if( NOT LLVM_ON_UNIX OR CYGWIN )
@@ -124,16 +125,9 @@ endmacro(add_llvm_utility name)
macro(add_llvm_target target_name)
- if( TABLEGEN_OUTPUT )
- add_custom_target(${target_name}Table_gen
- DEPENDS ${TABLEGEN_OUTPUT})
- add_dependencies(${target_name}Table_gen ${LLVM_COMMON_DEPENDS})
- endif( TABLEGEN_OUTPUT )
- include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
+ include_directories(BEFORE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR})
add_llvm_library(LLVM${target_name} ${ARGN} ${TABLEGEN_OUTPUT})
- if ( TABLEGEN_OUTPUT )
- add_dependencies(LLVM${target_name} ${target_name}Table_gen)
- set_target_properties(${target_name}Table_gen PROPERTIES FOLDER "Tablegenning")
- endif (TABLEGEN_OUTPUT)
set( CURRENT_LLVM_TARGET LLVM${target_name} )
endmacro(add_llvm_target)
OpenPOWER on IntegriCloud