From 282eb414596c6062e02880ca1cb537c06fd3b8a3 Mon Sep 17 00:00:00 2001 From: Ben Boeckel <ben.boeckel@kitware.com> Date: Wed, 25 Aug 2021 11:25:19 -0400 Subject: [PATCH] cmake: disable kits when building statically ParaView has witnessed that dependency cycles with its Python module loading strategy during static builds where kits are enabled. To avoid having this trip up users, just deny the configuration. --- CMakeLists.txt | 5 ++++- Documentation/dev/build.md | 6 +++--- Documentation/release/dev/no-static-kits.md | 8 ++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 Documentation/release/dev/no-static-kits.md diff --git a/CMakeLists.txt b/CMakeLists.txt index e4c296af268..65b93c34a3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -321,7 +321,10 @@ if ("VTK::Python" IN_LIST vtk_modules) endif () endif () -option(VTK_ENABLE_KITS "Enable kits compilation" OFF) +cmake_dependent_option(VTK_ENABLE_KITS "Enable kits compilation" OFF + # Static builds don't make sense with kits. Ignore the flag if shared + # libraries aren't being built. + "VTK_BUILD_SHARED_LIBS" OFF) mark_as_advanced(VTK_ENABLE_KITS) option(VTK_USE_EXTERNAL "Use external copies of third party libraries by default" OFF) diff --git a/Documentation/dev/build.md b/Documentation/dev/build.md index 720ffa3289f..bb290dd4664 100644 --- a/Documentation/dev/build.md +++ b/Documentation/dev/build.md @@ -171,9 +171,9 @@ Less common, but variables which may be of interest to some: values are `OFF` (no testing), `WANT` (enable tests as possible), and `ON` (enable all tests; may error out if features otherwise disabled are required by test code). - * `VTK_ENABLE_KITS` (default `OFF`): Compile VTK into - a smaller set of libraries. Can be useful on platforms where VTK takes a - long time to launch due to expensive disk access. + * `VTK_ENABLE_KITS` (default `OFF`; requires `BUILD_SHARED_LIBS`): Compile + VTK into a smaller set of libraries. Can be useful on platforms where VTK + takes a long time to launch due to expensive disk access. * `VTK_ENABLE_WRAPPING` (default `ON`): Whether any wrapping support will be available or not. * `VTK_WRAP_JAVA` (default `OFF`; requires `VTK_ENABLE_WRAPPING`): diff --git a/Documentation/release/dev/no-static-kits.md b/Documentation/release/dev/no-static-kits.md new file mode 100644 index 00000000000..97adda854a6 --- /dev/null +++ b/Documentation/release/dev/no-static-kits.md @@ -0,0 +1,8 @@ +## no-static-kits + +Static builds no longer allow building with kits. The goal of a kit build is to +reduce the number of runtime libraries needed, but this is not relevant in a +static build anyways. Additionally, there are issues that arise with static kit +builds that are lingering and rather than leaving them around for users to +accidentally run into, VTK now only considers `VTK_ENABLE_KITS` in shared +builds. -- GitLab