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

Yuri Gribov via flang-commits flang-commits at lists.llvm.org
Wed Jan 26 00:35:55 PST 2022


Author: Yury Gribov
Date: 2022-01-26T11:35:12+03:00
New Revision: a5cc8f6d5e49c957a3d37670beea733941b003f9

URL: https://github.com/llvm/llvm-project/commit/a5cc8f6d5e49c957a3d37670beea733941b003f9
DIFF: https://github.com/llvm/llvm-project/commit/a5cc8f6d5e49c957a3d37670beea733941b003f9.diff

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

Differential Revision: https://reviews.llvm.org/D117768

Added: 
    

Modified: 
    flang/tools/f18/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
index 8c09842359e7..aa77676c6229 100644
--- a/flang/tools/f18/CMakeLists.txt
+++ b/flang/tools/f18/CMakeLists.txt
@@ -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()


        


More information about the flang-commits mailing list