[flang-commits] [flang] a544761 - [Flang][runtime] Add dependency to build FortranRuntime after flang-new (#99737)

via flang-commits flang-commits at lists.llvm.org
Mon Jul 22 08:30:49 PDT 2024


Author: Michael Klemm
Date: 2024-07-22T17:30:45+02:00
New Revision: a5447613de6ce572e5b5e71821a1cb0d3ee890f3

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

LOG: [Flang][runtime] Add dependency to build FortranRuntime after flang-new (#99737)

Makefile-based builds did not have proper dependencies to built the
FortranRuntime target after Flang new is available. This PR introduces a
dependency to ensure that this is the case. Relates to PR #95388.

---------

Co-authored-by: Michael Kruse <github at meinersbur.de>

Added: 
    

Modified: 
    flang/runtime/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index 8588af7e16eec..d587fd44b1678 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -295,3 +295,15 @@ else()
     FortranRuntime.static_dbg FortranRuntime.dynamic_dbg)
 endif()
 set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries")
+
+# If FortranRuntime is part of a Flang build (and not a separate build) then
+# add dependency to make sure that Fortran runtime library is being built after
+# we have the Flang compiler available.  This also includes the MODULE files
+# that compile when the 'flang-new' target is built.
+#
+# TODO: This is a workaround and should be updated when runtime build procedure
+# is changed to a regular runtime build.  See discussion in PR #95388.
+if (TARGET flang-new AND TARGET module_files)
+  add_dependencies(FortranRuntime flang-new module_files)
+endif()
+


        


More information about the flang-commits mailing list