summaryrefslogtreecommitdiff
path: root/cmake/modules/AddLLVM.cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2011-07-25 14:11:55 +0000
committerOscar Fuentes <ofv@wanadoo.es>2011-07-25 14:11:55 +0000
commitddfb69cd47b6062bde9d6a0ac1576ad8ddcb5a9e (patch)
tree4f260b1c377eb73ab83724928b61977a4d6724db /cmake/modules/AddLLVM.cmake
parent6d0ac80d5e0412fc2dae8566a272159042af0006 (diff)
downloadllvm-ddfb69cd47b6062bde9d6a0ac1576ad8ddcb5a9e.tar.gz
llvm-ddfb69cd47b6062bde9d6a0ac1576ad8ddcb5a9e.tar.bz2
llvm-ddfb69cd47b6062bde9d6a0ac1576ad8ddcb5a9e.tar.xz
CMake: generalize the system that creates custom targets for
tablegenning to all libraries and executables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/AddLLVM.cmake')
-rwxr-xr-xcmake/modules/AddLLVM.cmake13
1 files changed, 4 insertions, 9 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index c13143bb0d..daeb46719c 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -2,6 +2,7 @@ include(LLVMProcessSources)
include(LLVM-Config)
macro(add_llvm_library name)
+ create_tablegenning_custom_target( ${name} )
llvm_process_sources( ALL_FILES ${ARGN} )
add_library( ${name} ${ALL_FILES} )
set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
@@ -32,6 +33,7 @@ macro(add_llvm_library name)
add_dependencies(${name} ${CURRENT_LLVM_TARGET})
endif()
set_target_properties(${name} PROPERTIES FOLDER "Libraries")
+ add_tablegenning_dependency( ${name} )
endmacro(add_llvm_library name)
@@ -75,6 +77,7 @@ endmacro(add_llvm_loadable_module name)
macro(add_llvm_executable name)
+ create_tablegenning_custom_target( ${name} )
llvm_process_sources( ALL_FILES ${ARGN} )
if( EXCLUDE_FROM_ALL )
add_executable(${name} EXCLUDE_FROM_ALL ${ALL_FILES})
@@ -88,6 +91,7 @@ macro(add_llvm_executable name)
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )
link_system_libs( ${name} )
+ add_tablegenning_dependency( ${name} )
endmacro(add_llvm_executable name)
@@ -124,16 +128,7 @@ 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})
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)