[flang-commits] [PATCH] D124759: [flang] Install Fortran_main library
Dan Palermo via Phabricator via flang-commits
flang-commits at lists.llvm.org
Thu May 12 14:58:34 PDT 2022
dpalermo requested changes to this revision.
dpalermo added a comment.
This revision now requires changes to proceed.
I went back to the original patch, added some more debugging, and found that the options in cmake_parse_arguments had a space instead of a semicolon so ARG_STATIC was never being set.
The changes below (original patch + semicolon instead of space) also now work for me:
diff --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake
index 369e303e148a..f6fc2ac363fc 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"
+ "SHARED;STATIC"
""
"ADDITIONAL_HEADERS"
${ARGN})
@@ -53,7 +53,7 @@ macro(add_flang_library name)
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)
diff --git a/flang/runtime/FortranMain/CMakeLists.txt b/flang/runtime/FortranMain/CMakeLists.txt
index aa214cee31ff..1d840ee5d1a3 100644
--- a/flang/runtime/FortranMain/CMakeLists.txt
+++ b/flang/runtime/FortranMain/CMakeLists.txt
@@ -1,3 +1,3 @@
-llvm_add_library(Fortran_main STATIC
+add_flang_library(Fortran_main STATIC
Fortran_main.c
)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124759/new/
https://reviews.llvm.org/D124759
More information about the flang-commits
mailing list