Skip to content

Commit a544761

Browse files
mjklemmMeinersbur
andauthored
[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 <[email protected]>
1 parent e970989 commit a544761

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

flang/runtime/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,15 @@ else()
295295
FortranRuntime.static_dbg FortranRuntime.dynamic_dbg)
296296
endif()
297297
set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries")
298+
299+
# If FortranRuntime is part of a Flang build (and not a separate build) then
300+
# add dependency to make sure that Fortran runtime library is being built after
301+
# we have the Flang compiler available. This also includes the MODULE files
302+
# that compile when the 'flang-new' target is built.
303+
#
304+
# TODO: This is a workaround and should be updated when runtime build procedure
305+
# is changed to a regular runtime build. See discussion in PR #95388.
306+
if (TARGET flang-new AND TARGET module_files)
307+
add_dependencies(FortranRuntime flang-new module_files)
308+
endif()
309+

0 commit comments

Comments
 (0)