diff --git a/glad/generator/__init__.py b/glad/generator/__init__.py index 75e017cf..14b4fb4d 100644 --- a/glad/generator/__init__.py +++ b/glad/generator/__init__.py @@ -57,7 +57,7 @@ def select(self, spec, api, version, profile, extensions, config, sink=LoggingSi :param sink: sink used to collect non fatal errors and information :return: FeatureSet with the required types, enums, commands/functions """ - return spec.select(api, version, profile, extensions, sink=sink) + return spec.select(api, version, profile, extensions, config, sink=sink) def generate(self, spec, feature_set, config, sink=LoggingSink(__name__)): """ diff --git a/glad/parse.py b/glad/parse.py index 33a99c01..736dc133 100644 --- a/glad/parse.py +++ b/glad/parse.py @@ -669,7 +669,7 @@ def split_types(iterable, types): return result - def select(self, api, version, profile, extension_names, sink=LoggingSink(__name__)): + def select(self, api, version, profile, extension_names, config, sink=LoggingSink(__name__)): """ Select a specific configuration from the specification. @@ -748,10 +748,13 @@ def select(self, api, version, profile, extension_names, sink=LoggingSink(__name if name in self.extensions[api]] # Load documentation for the specific configuration - if self.DOCS: - self._docs = self.DOCS(api, version, profile, extensions) - sink.info('loading documentation for api {} version {}'.format(api, version)) - self._docs.load() + if config['WITH_DOCS']: + if self.DOCS: + self._docs = self.DOCS(api, version, profile, extensions) + sink.info('loading documentation for api {} version {}'.format(api, version)) + self._docs.load() + else: + sink.warning("documentation not available for specification '{}'".format(self.name)) # Collect information result = set()