Skip to content

Commit 3a15146

Browse files
committed
only load documentation if --with-docs is present
1 parent 48d8bab commit 3a15146

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

glad/generator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def select(self, spec, api, version, profile, extensions, config, sink=LoggingSi
5757
:param sink: sink used to collect non fatal errors and information
5858
:return: FeatureSet with the required types, enums, commands/functions
5959
"""
60-
return spec.select(api, version, profile, extensions, sink=sink)
60+
return spec.select(api, version, profile, extensions, config, sink=sink)
6161

6262
def generate(self, spec, feature_set, config, sink=LoggingSink(__name__)):
6363
"""

glad/parse.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def split_types(iterable, types):
669669

670670
return result
671671

672-
def select(self, api, version, profile, extension_names, sink=LoggingSink(__name__)):
672+
def select(self, api, version, profile, extension_names, config, sink=LoggingSink(__name__)):
673673
"""
674674
Select a specific configuration from the specification.
675675
@@ -748,10 +748,13 @@ def select(self, api, version, profile, extension_names, sink=LoggingSink(__name
748748
if name in self.extensions[api]]
749749

750750
# Load documentation for the specific configuration
751-
if self.DOCS:
752-
self._docs = self.DOCS(api, version, profile, extensions)
753-
sink.info('loading documentation for api {} version {}'.format(api, version))
754-
self._docs.load()
751+
if config['WITH_DOCS']:
752+
if self.DOCS:
753+
self._docs = self.DOCS(api, version, profile, extensions)
754+
sink.info('loading documentation for api {} version {}'.format(api, version))
755+
self._docs.load()
756+
else:
757+
sink.warning("documentation not available for specification '{}'".format(self.name))
755758

756759
# Collect information
757760
result = set()

0 commit comments

Comments
 (0)