summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab/ci/configure_windows_vs2022_x64.cmake2
-rw-r--r--Help/command/enable_language.rst4
-rw-r--r--Help/command/project.rst3
-rw-r--r--Help/prop_sf/GENERATED.rst2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx24
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
-rw-r--r--Utilities/Sphinx/cmake.py29
7 files changed, 57 insertions, 8 deletions
diff --git a/.gitlab/ci/configure_windows_vs2022_x64.cmake b/.gitlab/ci/configure_windows_vs2022_x64.cmake
index 290d380..51ee514 100644
--- a/.gitlab/ci/configure_windows_vs2022_x64.cmake
+++ b/.gitlab/ci/configure_windows_vs2022_x64.cmake
@@ -1,4 +1,4 @@
-set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions" CACHE STRING "")
+set(CMake_TEST_MODULE_COMPILATION "named,partitions,internal_partitions,shared" CACHE STRING "")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_msvc_cxx_modules_common.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_vs_common.cmake")
diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst
index 21b38ba..2f1cc23 100644
--- a/Help/command/enable_language.rst
+++ b/Help/command/enable_language.rst
@@ -13,10 +13,6 @@ variables that are created by the project command.
.. include:: SUPPORTED_LANGUAGES.txt
-By default ``C`` and ``CXX`` are enabled if no language options are given.
-Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages,
-to skip enabling any languages.
-
This command must be called in file scope, not in a function call.
Furthermore, it must be called in the highest directory common to all
targets using the named language directly for compiling sources or
diff --git a/Help/command/project.rst b/Help/command/project.rst
index ab93f3d..d695789 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -105,6 +105,9 @@ The options are:
.. include:: SUPPORTED_LANGUAGES.txt
+By default ``C`` and ``CXX`` are enabled if no language options are given.
+Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages,
+to skip enabling any languages.
The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL``
options are intended for use as default values in package metadata and documentation.
diff --git a/Help/prop_sf/GENERATED.rst b/Help/prop_sf/GENERATED.rst
index 216dfe8..5ecc86c 100644
--- a/Help/prop_sf/GENERATED.rst
+++ b/Help/prop_sf/GENERATED.rst
@@ -14,7 +14,7 @@ validity checks.
Any file that is
- created by the execution of commands such as
- :command:`add_custom_command` and :command:`file(GENERATE)`
+ :command:`add_custom_command` which run during the build
- listed as one of the ``BYPRODUCTS`` of an :command:`add_custom_command`
or :command:`add_custom_target` command, or
- created by a CMake ``AUTOGEN`` operation such as :prop_tgt:`AUTOMOC`,
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 7975018..33152f2 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -793,6 +793,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
this->WriteWinRTPackageCertificateKeyFile(e0);
this->WritePathAndIncrementalLinkOptions(e0);
+ this->WritePublicProjectContentOptions(e0);
this->WriteCEDebugProjectConfigurationValues(e0);
this->WriteItemDefinitionGroups(e0);
this->WriteCustomCommands(e0);
@@ -3115,6 +3116,29 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
}
}
+void cmVisualStudio10TargetGenerator::WritePublicProjectContentOptions(
+ Elem& e0)
+{
+ cmStateEnums::TargetType ttype = this->GeneratorTarget->GetType();
+ if (ttype != cmStateEnums::SHARED_LIBRARY) {
+ return;
+ }
+ if (this->ProjectType != VsProjectType::vcxproj) {
+ return;
+ }
+
+ Elem e1(e0, "PropertyGroup");
+ for (std::string const& config : this->Configurations) {
+ if (this->GeneratorTarget->HaveCxx20ModuleSources() &&
+ this->GeneratorTarget->HaveCxxModuleSupport(config) ==
+ cmGeneratorTarget::Cxx20SupportLevel::Supported) {
+ const std::string cond = this->CalcCondition(config);
+ // For DLL projects, we export all BMIs for now
+ e1.WritePlatformConfigTag("AllProjectBMIsArePublic", cond, "true");
+ }
+ }
+}
+
void cmVisualStudio10TargetGenerator::OutputLinkIncremental(
Elem& e1, std::string const& configName)
{
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index a87cb01..ffab91f 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -97,6 +97,7 @@ private:
void WriteWinRTPackageCertificateKeyFile(Elem& e0);
void WriteXamlFilesGroup(Elem& e0);
void WritePathAndIncrementalLinkOptions(Elem& e0);
+ void WritePublicProjectContentOptions(Elem& e0);
void WriteItemDefinitionGroups(Elem& e0);
void VerifyNecessaryFiles();
void WriteMissingFiles(Elem& e1);
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 0afd705..60bfb33 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -582,12 +582,23 @@ class CMakeXRefTransform(Transform):
# after the sphinx (210) and docutils (220) substitutions.
default_priority = 221
+ # This helper supports docutils < 0.18, which is missing 'findall',
+ # and docutils == 0.18.0, which is missing 'traverse'.
+ def _document_findall_as_list(self, condition):
+ if hasattr(self.document, 'findall'):
+ # Fully iterate into a list so the caller can grow 'self.document'
+ # while iterating.
+ return list(self.document.findall(condition))
+
+ # Fallback to 'traverse' on old docutils, which returns a list.
+ return self.document.traverse(condition)
+
def apply(self):
env = self.document.settings.env
# Find CMake cross-reference nodes and add index and target
# nodes for them.
- for ref in self.document.traverse(addnodes.pending_xref):
+ for ref in self._document_findall_as_list(addnodes.pending_xref):
if not ref['refdomain'] == 'cmake':
continue
@@ -668,7 +679,7 @@ class CMakeDomain(Domain):
'manual': CMakeXRefRole(),
}
initial_data = {
- 'objects': {}, # fullname -> docname, objtype
+ 'objects': {}, # fullname -> ObjectEntry
}
def clear_doc(self, docname):
@@ -679,6 +690,20 @@ class CMakeDomain(Domain):
for fullname in to_clear:
del self.data['objects'][fullname]
+ def merge_domaindata(self, docnames, otherdata):
+ """Merge domaindata from the workers/chunks when they return.
+
+ Called once per parallelization chunk.
+ Only used when sphinx is run in parallel mode.
+
+ :param docnames: a Set of the docnames that are part of the current
+ chunk to merge
+ :param otherdata: the partial data calculated by the current chunk
+ """
+ for refname, obj in otherdata['objects'].items():
+ if obj.docname in docnames:
+ self.data['objects'][refname] = obj
+
def resolve_xref(self, env, fromdocname, builder,
typ, target, node, contnode):
targetid = f'{typ}:{target}'