[flang-commits] [PATCH] D124759: [flang] Install Fortran_main library
Diana Picus via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed May 11 03:11:36 PDT 2022
rovka updated this revision to Diff 428603.
rovka edited the summary of this revision.
rovka added a comment.
@dpalermo Thanks for trying it out! I've updated the review with your patch. I guess it's ok to treat Fortran_main differently from the other libs, and anyway it's difficult for me to test that all the other things in add_flang_library actually work as expected for it. So it seems like a good idea to split out just the part dealing with the install. Would you like to commit this yourself? If not, I can just add you as author and commit it.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124759/new/
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,5 @@
llvm_add_library(Fortran_main STATIC
Fortran_main.c
)
+
+install_flang_library(Fortran_main)
Index: flang/cmake/modules/AddFlang.cmake
===================================================================
--- flang/cmake/modules/AddFlang.cmake
+++ flang/cmake/modules/AddFlang.cmake
@@ -16,6 +16,27 @@
add_llvm_subdirectory(FLANG TOOL ${name})
endmacro()
+macro(install_flang_library name)
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libflang")
+ get_target_export_arg(${name} Flang export_to_flangtargets UMBRELLA flang-libraries)
+ install(TARGETS ${name}
+ COMPONENT ${name}
+ ${export_to_flangtargets}
+ LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+
+ if (NOT LLVM_ENABLE_IDE)
+ add_llvm_install_targets(install-${name}
+ DEPENDS ${name}
+ COMPONENT ${name})
+ endif()
+
+ set_property(GLOBAL APPEND PROPERTY FLANG_LIBS ${name})
+ endif()
+ set_property(GLOBAL APPEND PROPERTY FLANG_EXPORTS ${name})
+endmacro()
+
macro(add_flang_library name)
cmake_parse_arguments(ARG
"SHARED"
@@ -64,25 +85,7 @@
llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
if (TARGET ${name})
-
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libflang")
- get_target_export_arg(${name} Flang export_to_flangtargets UMBRELLA flang-libraries)
- install(TARGETS ${name}
- COMPONENT ${name}
- ${export_to_flangtargets}
- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-
- if (NOT LLVM_ENABLE_IDE)
- add_llvm_install_targets(install-${name}
- DEPENDS ${name}
- COMPONENT ${name})
- endif()
-
- set_property(GLOBAL APPEND PROPERTY FLANG_LIBS ${name})
- endif()
- set_property(GLOBAL APPEND PROPERTY FLANG_EXPORTS ${name})
+ install_flang_library(${name})
else()
# Add empty "phony" target
add_custom_target(${name})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124759.428603.patch
Type: text/x-patch
Size: 2439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220511/e6cf0755/attachment.bin>
More information about the flang-commits
mailing list