-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (23 loc) · 888 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
cmake_minimum_required(VERSION 3.10)
project(custom-tblgen-backend)
cmake_policy(SET CMP0077 NEW)
find_package(LLVM REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR})
include_directories(${LLVM_INCLUDE_DIRS})
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
NO_DEFAULT_PATH)
include(AddLLVM)
include(TableGen)
include(HandleLLVMOptions)
include(VersionFromVCS)
include(LLVMDistributionSupport)
add_subdirectory(src)
set(CURR_DIR ${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(
OUTPUT ${CURR_DIR}/${CUSTOM_TABLEGEN_EXE}
COMMAND ${CMAKE_COMMAND} -E copy ${CURR_DIR}/src/${CUSTOM_TABLEGEN_EXE}
${CURR_DIR}/${CUSTOM_TABLEGEN_EXE}
DEPENDS ${CURR_DIR}/src/${CUSTOM_TABLEGEN_EXE}
)
add_custom_target(copy-binary ALL DEPENDS ${CURR_DIR}/${CUSTOM_TABLEGEN_EXE})
add_dependencies(copy-binary ${CUSTOM_TABLEGEN_TARGET})