source: clamav/trunk/libclamav/c++/llvm/cmake/modules/TableGen.cmake@ 319

Last change on this file since 319 was 319, checked in by Yuri Dario, 14 years ago

clamav: update trunk to 0.97.

File size: 1.1 KB
Line 
1# LLVM_TARGET_DEFINITIONS must contain the name of the .td file to process.
2# Extra parameters for `tblgen' may come after `ofn' parameter.
3# Adds the name of the generated file to TABLEGEN_OUTPUT.
4
5macro(tablegen ofn)
6 file(GLOB local_tds "*.td")
7 file(GLOB_RECURSE global_tds "${LLVM_MAIN_SRC_DIR}/include/llvm/*.td")
8
9 if (IS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
10 set(LLVM_TARGET_DEFINITIONS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
11 else()
12 set(LLVM_TARGET_DEFINITIONS_ABSOLUTE
13 ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS})
14 endif()
15 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
16 COMMAND ${LLVM_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
17 -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
18 ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
19 -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
20 DEPENDS tblgen ${local_tds} ${global_tds}
21 COMMENT "Building ${ofn}..."
22 )
23 set(TABLEGEN_OUTPUT ${TABLEGEN_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR}/${ofn})
24 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ofn}
25 PROPERTIES GENERATED 1)
26endmacro(tablegen)
Note: See TracBrowser for help on using the repository browser.