[flang-commits] [PATCH] D131670: [flang] Install runtime libs with LLVM_INSTALL_TOOLCHAIN_ONLY

Diana Picus via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Aug 11 05:15:10 PDT 2022


rovka created this revision.
rovka added reviewers: awarzynski, Meinersbur.
rovka added a project: Flang.
Herald added subscribers: jdoerfert, mgorny.
Herald added a reviewer: sscalpone.
Herald added a project: All.
rovka requested review of this revision.

Make sure that FortranDecimal, FortranRuntime and Fortran_main are
installed/packaged even when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled.
They are used by flang to link executables, so they should be provided
even with minimal installs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131670

Files:
  flang/cmake/modules/AddFlang.cmake
  flang/lib/Decimal/CMakeLists.txt
  flang/runtime/CMakeLists.txt
  flang/runtime/FortranMain/CMakeLists.txt


Index: flang/runtime/FortranMain/CMakeLists.txt
===================================================================
--- flang/runtime/FortranMain/CMakeLists.txt
+++ flang/runtime/FortranMain/CMakeLists.txt
@@ -1,3 +1,3 @@
-add_flang_library(Fortran_main STATIC
+add_flang_library(Fortran_main STATIC INSTALL_WITH_TOOLCHAIN
   Fortran_main.c
 )
Index: flang/runtime/CMakeLists.txt
===================================================================
--- flang/runtime/CMakeLists.txt
+++ flang/runtime/CMakeLists.txt
@@ -88,4 +88,6 @@
 
   LINK_LIBS
   FortranDecimal
+
+  INSTALL_WITH_TOOLCHAIN
 )
Index: flang/lib/Decimal/CMakeLists.txt
===================================================================
--- flang/lib/Decimal/CMakeLists.txt
+++ flang/lib/Decimal/CMakeLists.txt
@@ -1,5 +1,5 @@
 
-add_flang_library(FortranDecimal
+add_flang_library(FortranDecimal INSTALL_WITH_TOOLCHAIN
   binary-to-decimal.cpp
   decimal-to-binary.cpp
 )
Index: flang/cmake/modules/AddFlang.cmake
===================================================================
--- flang/cmake/modules/AddFlang.cmake
+++ flang/cmake/modules/AddFlang.cmake
@@ -18,7 +18,7 @@
 
 macro(add_flang_library name)
   cmake_parse_arguments(ARG
-    "SHARED;STATIC"
+    "SHARED;STATIC;INSTALL_WITH_TOOLCHAIN"
     ""
     "ADDITIONAL_HEADERS"
     ${ARGN})
@@ -65,7 +65,8 @@
 
   if (TARGET ${name})
 
-    if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libflang")
+    if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libflang"
+        OR ARG_INSTALL_WITH_TOOLCHAIN)
       get_target_export_arg(${name} Flang export_to_flangtargets UMBRELLA flang-libraries)
       install(TARGETS ${name}
         COMPONENT ${name}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131670.451807.patch
Type: text/x-patch
Size: 1701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220811/6f98efb4/attachment.bin>


More information about the flang-commits mailing list