[flang] Rename `flang` as `flang-to-external-fc`
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Tue, 17 May 2022 19:36:27 +0000 (19:36 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Tue, 31 May 2022 18:37:50 +0000 (18:37 +0000)
Our ultimate goal is to rename `flang-new` as `flang`. This is "Step 1"
in which we only rename the bash wrapper script, `flang`, as
`flang-to-external-fc`. The new name more accurately reflects what the
wrapper script does.

With this patch, `flang` becomes a symbolic link pointing to
`flang-to-external-fc`. This allows a smooth transmission for any
buildbots that use this script. Once the buildbots are reconfigured to
use the updated name, CMake rule for the symbolic link will be removed.

For more context see:
  * https://discourse.llvm.org/t/rename-flang-new-as-flang,
  * https://reviews.llvm.org/D125788.

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

flang/tools/f18/CMakeLists.txt
flang/tools/f18/flang-to-external-fc [moved from flang/tools/f18/flang with 100% similarity]

index 798f3ed..3e96c84 100644 (file)
@@ -51,12 +51,14 @@ add_custom_target(module_files ALL DEPENDS ${MODULE_FILES})
 # This flang shell script will only work in a POSIX shell.
 if (NOT WIN32)
   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}")
+    OUTPUT ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc
+    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/flang-to-external-fc
+    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/flang-to-external-fc ${CMAKE_BINARY_DIR}/bin)
+  add_custom_target(flang-to-external-fc ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc)
+  install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc DESTINATION "${CMAKE_INSTALL_BINDIR}")
 endif()
+add_custom_target(flang-slink ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc COMMAND ${CMAKE_COMMAND} -E create_symlink
+  ${CMAKE_BINARY_DIR}/bin/flang-to-external-fc ${CMAKE_BINARY_DIR}/bin/flang)
 
 # TODO Move this to a more suitable location
 file(COPY ${FLANG_SOURCE_DIR}/module/omp_lib.h DESTINATION "${CMAKE_BINARY_DIR}/include/flang/OpenMP/" FILE_PERMISSIONS OWNER_READ OWNER_WRITE)