Skip to content

Commit

Permalink
Export LTC Headers (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniojkim authored and henrytwo committed Jul 29, 2022
1 parent a876601 commit f64bb18
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions python/torch_mlir/csrc/base_lazy_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,30 @@ target_link_libraries(torch_mlir_ltc_backend

message(STATUS "TORCH_CXXFLAGS=${TORCH_CXXFLAGS} -Wno-pedantic")
set_target_properties(torch_mlir_ltc_backend PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/"
OUTPUT_NAME lib_mlir_ltc
LIBRARY_OUTPUT_DIRECTORY "${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/base_lazy_backend"
OUTPUT_NAME lib_torch_mlir_ltc
PREFIX ""
SUFFIX ".so"
CXX_VISIBILITY_PRESET "hidden"
COMPILE_FLAGS "${TORCH_CXXFLAGS} -Wno-pedantic"
LINK_FLAGS "-rdynamic"
)

# Copy header files into python package

add_custom_command(
TARGET torch_mlir_ltc_backend POST_BUILD
COMMAND mkdir -p
${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/base_lazy_backend/generated/)

add_custom_command(
TARGET torch_mlir_ltc_backend POST_BUILD
COMMAND cp
${PROJECT_SOURCE_DIR}/python/torch_mlir/csrc/base_lazy_backend/*.h
${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/base_lazy_backend/)

add_custom_command(
TARGET torch_mlir_ltc_backend POST_BUILD
COMMAND cp
${PROJECT_SOURCE_DIR}/python/torch_mlir/csrc/base_lazy_backend/generated/*.h
${TORCH_MLIR_PYTHON_PACKAGES_DIR}/torch_mlir/torch_mlir/base_lazy_backend/generated/)

0 comments on commit f64bb18

Please sign in to comment.