llvm.org GIT mirror llvm / 46e8559
TableGen.cmake: Functionalize and reformat. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201972 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 6 years ago
1 changed file(s) with 16 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
5151 PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${ofn}.tmp ${ofn})
5252
5353 set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn} PARENT_SCOPE)
54 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ofn}
55 PROPERTIES GENERATED 1)
56 endfunction(tablegen)
54 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ofn} PROPERTIES
55 GENERATED 1)
56 endfunction()
5757
58 macro(add_public_tablegen_target target)
59 # Creates a target for publicly exporting tablegen dependencies.
60 if( TABLEGEN_OUTPUT )
61 add_custom_target(${target}
62 DEPENDS ${TABLEGEN_OUTPUT})
63 if (LLVM_COMMON_DEPENDS)
64 add_dependencies(${target} ${LLVM_COMMON_DEPENDS})
65 endif ()
66 set_target_properties(${target} PROPERTIES FOLDER "Tablegenning")
67 list(APPEND LLVM_COMMON_DEPENDS ${target})
68 endif( TABLEGEN_OUTPUT )
69 endmacro()
58 # Creates a target for publicly exporting tablegen dependencies.
59 function(add_public_tablegen_target target)
60 if(NOT TABLEGEN_OUTPUT)
61 message(FATAL_ERROR "Requires tablegen() definitions as TABLEGEN_OUTPUT.")
62 endif()
63 add_custom_target(${target}
64 DEPENDS ${TABLEGEN_OUTPUT})
65 if(LLVM_COMMON_DEPENDS)
66 add_dependencies(${target} ${LLVM_COMMON_DEPENDS})
67 endif()
68 set_target_properties(${target} PROPERTIES FOLDER "Tablegenning")
69 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${target} PARENT_SCOPE)
70 endfunction()
7071
7172 if(CMAKE_CROSSCOMPILING)
7273 set(CX_NATIVE_TG_DIR "${CMAKE_BINARY_DIR}/native")