[flang-commits] [PATCH] D124759: [flang] Install Fortran_main library
Diana Picus via Phabricator via flang-commits
flang-commits at lists.llvm.org
Mon May 2 04:48:16 PDT 2022
rovka created this revision.
rovka added reviewers: jeanPerier, pmccormick, klausler.
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.
At the moment the Fortran_main library is not installed, so it cannot be
found by the driver when run from an install directory. This patch fixes
the issue by replacing llvm_add_library with add_flang_library, which
already contains all the proper incantations for installing a library.
It also enhances add_flang_library to support a STATIC arg which forces
the library to be static even when BUILD_SHARED_LIBS is on.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D124759
Files:
flang/cmake/modules/AddFlang.cmake
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 @@
-llvm_add_library(Fortran_main STATIC
+add_flang_library(Fortran_main STATIC
Fortran_main.c
)
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"
+ "SHARED STATIC"
""
"ADDITIONAL_HEADERS"
${ARGN})
@@ -53,7 +53,7 @@
else()
# llvm_add_library ignores BUILD_SHARED_LIBS if STATIC is explicitly set,
# so we need to handle it here.
- if (BUILD_SHARED_LIBS)
+ if (BUILD_SHARED_LIBS AND NOT ARG_STATIC)
set(LIBTYPE SHARED OBJECT)
else()
set(LIBTYPE STATIC OBJECT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124759.426375.patch
Type: text/x-patch
Size: 970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220502/6941faf7/attachment.bin>
More information about the flang-commits
mailing list