Add some CMake rules for installing headers, mlir-tblgen, and mlir-opt

Closes tensorflow/mlir#246

PiperOrigin-RevId: 281442685
This commit is contained in:
Eric Schweitz 2019-11-19 21:04:45 -08:00 committed by A. Unique TensorFlower
parent f868adafee
commit 88368a19aa
2 changed files with 29 additions and 1 deletions

View file

@ -56,3 +56,31 @@ add_subdirectory(test)
if( LLVM_INCLUDE_EXAMPLES ) if( LLVM_INCLUDE_EXAMPLES )
add_subdirectory(examples) add_subdirectory(examples)
endif() endif()
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(DIRECTORY include/mlir include/mlir-c
DESTINATION include
COMPONENT mlir-headers
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.inc"
PATTERN "LICENSE.TXT"
)
install(DIRECTORY ${MLIR_INCLUDE_DIR}/mlir ${MLIR_INCLUDE_DIR}/mlir-c
DESTINATION include
COMPONENT mlir-headers
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.gen"
PATTERN "*.inc"
PATTERN "CMakeFiles" EXCLUDE
PATTERN "config.h" EXCLUDE
)
if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-mlir-headers
DEPENDS mlir-headers
COMPONENT mlir-headers)
endif()
endif()

View file

@ -56,7 +56,7 @@ if(MLIR_CUDA_CONVERSIONS_ENABLED)
MLIRGPUtoCUDATransforms MLIRGPUtoCUDATransforms
) )
endif() endif()
add_llvm_executable(mlir-opt add_llvm_tool(mlir-opt
mlir-opt.cpp mlir-opt.cpp
) )
llvm_update_compile_flags(mlir-opt) llvm_update_compile_flags(mlir-opt)