[flang] Add a custom target for the "flang" wrapper script.

Differential Revision: https://reviews.llvm.org/D117768
This commit is contained in:
Yury Gribov 2022-01-19 19:48:54 +09:00 committed by Yuri Gribov
parent d3f5ef241a
commit a5cc8f6d5e

View File

@ -45,8 +45,10 @@ add_custom_target(module_files ALL DEPENDS ${MODULE_FILES})
# This flang shell script will only work in a POSIX shell.
if (NOT WIN32)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/flang
DESTINATION ${CMAKE_BINARY_DIR}/bin
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/bin/flang
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/flang
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/flang ${CMAKE_BINARY_DIR}/bin)
add_custom_target(flang ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/flang)
install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()