[flang-commits] [flang] 8150c1b - [flang] Disable Plugins in out-of-tree builds
Andrzej Warzynski via flang-commits
flang-commits at lists.llvm.org
Thu Aug 12 12:30:17 PDT 2021
Author: Andrzej Warzynski
Date: 2021-08-12T19:29:28Z
New Revision: 8150c1bd8e262981a81f82e6e2f1d7ae07bdd67b
URL: https://github.com/llvm/llvm-project/commit/8150c1bd8e262981a81f82e6e2f1d7ae07bdd67b
DIFF: https://github.com/llvm/llvm-project/commit/8150c1bd8e262981a81f82e6e2f1d7ae07bdd67b.diff
LOG: [flang] Disable Plugins in out-of-tree builds
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.
Differential Revision: https://reviews.llvm.org/D107973
Added:
Modified:
flang/CMakeLists.txt
flang/test/CMakeLists.txt
Removed:
################################################################################
diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index cf6055075c38..f17816ee29b8 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -392,6 +392,9 @@ endif()
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)
diff --git a/flang/test/CMakeLists.txt b/flang/test/CMakeLists.txt
index 8cd1e0ef93d1..d7a7dccdc172 100644
--- a/flang/test/CMakeLists.txt
+++ b/flang/test/CMakeLists.txt
@@ -9,13 +9,23 @@ llvm_canonicalize_cmake_booleans(
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(
More information about the flang-commits
mailing list