[flang-commits] [flang] [Flang][runtime] Add dependency to build FortranRuntime after flang-new (PR #99737)
Michael Klemm via flang-commits
flang-commits at lists.llvm.org
Mon Jul 22 07:26:23 PDT 2024
https://github.com/mjklemm updated https://github.com/llvm/llvm-project/pull/99737
>From b4702ccc8fa54a7fd36693db65f900d6bcd784cf Mon Sep 17 00:00:00 2001
From: Michael Klemm <michael.klemm at amd.com>
Date: Sat, 20 Jul 2024 06:42:49 +0200
Subject: [PATCH 1/4] [Flang][runtime] Add dependency to build FortranRuntime
after flang-new
---
flang/runtime/CMakeLists.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index 8588af7e16eec..6d435f00b8965 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -295,3 +295,9 @@ else()
FortranRuntime.static_dbg FortranRuntime.dynamic_dbg)
endif()
set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries")
+
+# 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.
+add_dependencies(FortranRuntime flang-new)
+
>From 53676705f34f4b1a32c0a690d57ab5861638aa14 Mon Sep 17 00:00:00 2001
From: Michael Klemm <michael.klemm at amd.com>
Date: Sat, 20 Jul 2024 07:20:42 +0200
Subject: [PATCH 2/4] Also depend on module_files
---
flang/runtime/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index 6d435f00b8965..5ac9f830265da 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -299,5 +299,5 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries"
# 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.
-add_dependencies(FortranRuntime flang-new)
+add_dependencies(FortranRuntime flang-new module_files)
>From 4c1e846a8243954c4fbf80e5434521537eb70a80 Mon Sep 17 00:00:00 2001
From: Michael Klemm <michael.klemm at amd.com>
Date: Sat, 20 Jul 2024 16:35:08 +0200
Subject: [PATCH 3/4] Disable dependency on Flang if built as a separate
project
---
flang/runtime/CMakeLists.txt | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index 5ac9f830265da..d2d70ff6732f8 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -296,8 +296,14 @@ else()
endif()
set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries")
-# Add dependency to make sure that Fortran runtime library is being built after
+# 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.
-add_dependencies(FortranRuntime flang-new module_files)
+#
+# 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)
+ add_dependencies(FortranRuntime flang-new module_files)
+endif()
>From fbc6f3e15793a7a551716ebe70261f5b154e8b17 Mon Sep 17 00:00:00 2001
From: Michael Klemm <michael.klemm at amd.com>
Date: Mon, 22 Jul 2024 16:26:11 +0200
Subject: [PATCH 4/4] Update flang/runtime/CMakeLists.txt
Co-authored-by: Michael Kruse <github at meinersbur.de>
---
flang/runtime/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index d2d70ff6732f8..d587fd44b1678 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -303,7 +303,7 @@ set_target_properties(FortranRuntime PROPERTIES FOLDER "Flang/Runtime Libraries"
#
# 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)
+if (TARGET flang-new AND TARGET module_files)
add_dependencies(FortranRuntime flang-new module_files)
endif()
More information about the flang-commits
mailing list