[PATCH] D107973: [flang] Disable Plugins in out-of-tree builds
Andrzej Warzynski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 12 09:17:57 PDT 2021
awarzynski created this revision.
Herald added a subscriber: mgorny.
Herald added a reviewer: sscalpone.
awarzynski requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
https://reviews.llvm.org/D106137 added support for plugins in Flang. The
CMake configuration for plugins requires some LLVM variables that are
not available in out-of-tree builds (e.g. `LLVM_SHLIB_OUTPUT_INTDIR`).
This has caused the out-of-tree BuildBot worker to start failing:
- https://lab.llvm.org/buildbot/#/builders/175
This patch effectively disables plugins in out-of-tree builds and fixes
the configuration error. In order to support plugins in out-of-tree
builds, we would have to find a way to access the missing CMake
variables from LLVM. This could be implemented at a later time.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107973
Files:
flang/CMakeLists.txt
flang/test/CMakeLists.txt
Index: flang/test/CMakeLists.txt
===================================================================
--- flang/test/CMakeLists.txt
+++ flang/test/CMakeLists.txt
@@ -9,13 +9,23 @@
set(FLANG_TOOLS_DIR ${FLANG_BINARY_DIR}/bin)
+# FIXME In out-of-tree builds, "SHLIBDIR" is undefined and passing it to
+# `configure_lit_site_cfg` leads to a configuration error. This is currently
+# only required by plugins/examples, which are not supported in out-of-tree
+# builds.
+if (FLANG_STANDALONE_BUILD)
+ set(PATHS_FOR_PLUGINS "")
+else ()
+ set(PATHS_FOR_PLUGINS "SHLIBDIR")
+endif ()
+
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
MAIN_CONFIG
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
PATHS
- "SHLIBDIR"
+ ${PATHS_FOR_PLUGINS}
)
configure_lit_site_cfg(
Index: flang/CMakeLists.txt
===================================================================
--- flang/CMakeLists.txt
+++ flang/CMakeLists.txt
@@ -392,6 +392,9 @@
add_subdirectory(runtime)
option(FLANG_BUILD_EXAMPLES "Build Flang example programs by default." OFF)
+if (FLANG_BUILD_EXAMPLES AND FLANG_STANDALONE_BUILD)
+ message(FATAL_ERROR "Examples are not supported in out-of-tree builds.")
+endif()
add_subdirectory(examples)
if (FLANG_INCLUDE_TESTS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107973.366018.patch
Type: text/x-patch
Size: 1308 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210812/e8c73a53/attachment.bin>
More information about the llvm-commits
mailing list