[flang-commits] [flang] 467abac - [flang] Install runtime libs with the toolchain

Diana Picus via flang-commits flang-commits at lists.llvm.org
Mon Aug 15 00:45:37 PDT 2022


Author: Diana Picus
Date: 2022-08-15T07:43:47Z
New Revision: 467abac2046d037f8d4cf428e76b77e5b06c187f

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

LOG: [flang] Install runtime libs with the toolchain

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.

Differential Revision: https://reviews.llvm.org/D131670

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake
index 7c71d2b7b044c..d516ca31b51fa 100644
--- a/flang/cmake/modules/AddFlang.cmake
+++ b/flang/cmake/modules/AddFlang.cmake
@@ -18,7 +18,7 @@ endmacro()
 
 macro(add_flang_library name)
   cmake_parse_arguments(ARG
-    "SHARED;STATIC"
+    "SHARED;STATIC;INSTALL_WITH_TOOLCHAIN"
     ""
     "ADDITIONAL_HEADERS"
     ${ARGN})
@@ -65,7 +65,8 @@ macro(add_flang_library name)
 
   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}

diff  --git a/flang/lib/Decimal/CMakeLists.txt b/flang/lib/Decimal/CMakeLists.txt
index 18655f096f0d9..3430fa5913819 100644
--- a/flang/lib/Decimal/CMakeLists.txt
+++ b/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
 )

diff  --git a/flang/runtime/CMakeLists.txt b/flang/runtime/CMakeLists.txt
index ce8a615642341..5c61cebf3c709 100644
--- a/flang/runtime/CMakeLists.txt
+++ b/flang/runtime/CMakeLists.txt
@@ -88,4 +88,6 @@ add_flang_library(FortranRuntime
 
   LINK_LIBS
   FortranDecimal
+
+  INSTALL_WITH_TOOLCHAIN
 )

diff  --git a/flang/runtime/FortranMain/CMakeLists.txt b/flang/runtime/FortranMain/CMakeLists.txt
index 1d840ee5d1a38..fe0d607c3f1a9 100644
--- a/flang/runtime/FortranMain/CMakeLists.txt
+++ b/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
 )


        


More information about the flang-commits mailing list