diff options
Diffstat (limited to 'cmake/modules/AddLLVM.cmake')
-rwxr-xr-x | cmake/modules/AddLLVM.cmake | 28 |
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) |