Skip to content

Commit

Permalink
[Flang][runtime] Add dependency to build FortranRuntime after flang-n…
Browse files Browse the repository at this point in the history
…ew (#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@meinersbur.de>
  • Loading branch information
2 people authored and yuxuanchen1997 committed Jul 25, 2024
1 parent f8cb58d commit 62530b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions flang/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 62530b4

Please sign in to comment.