Lines Matching +full:line +full:- +full:name

3 # SPDX-License-Identifier: Apache-2.0
26 '''Name of the default CMake generator.'''
78 :param build_directory: runs "cmake --build build_directory"
80 these come after "--build <build_directory>"
81 on the command line.
83 Any additional keyword arguments are passed as-is to run_cmake().
86 return run_cmake(['--build', build_directory] + extra_args, **kwargs)
99 alpha_under = re.compile('[A-Za-z_]')
100 alpha_num_under = re.compile('[A-Za-z0-9_]')
120 ---------- -------------------------------------------
128 ---------- -------------------------------------------
135 # expression. To be permissive here, use a non-greedy match up to
136 # the first colon (':'). This breaks if the variable name has a
139 r'''(?P<name>.*?) # name
149 # non-zero number. False if the constant is 0, OFF, NO,
151 # the suffix -NOTFOUND. Named boolean constants are
152 # case-insensitive. If the argument is not one of these
161 elif val.endswith('-NOTFOUND'):
171 def from_line(cls, line, line_no): argument
172 # Comments can only occur at the beginning of a line.
174 if line.startswith('//') or line.startswith('#'):
177 # Whitespace-only lines do not contain cache entries.
178 if not line.strip():
181 m = cls.CACHE_ENTRY.match(line)
185 name, type_, value = (m.group(g) for g in ('name', 'type', 'value'))
190 args = exc.args + ('on line {}: {}'.format(line_no, line),)
198 return CMakeCacheEntry(name, value)
200 def __init__(self, name, value): argument
201 self.name = name
205 fmt = 'CMakeCacheEntry(name={}, value={})'
206 return fmt.format(self.name, self.value)
222 with open(cache_file, 'r', encoding="utf-8") as cache:
223 for line_no, line in enumerate(cache):
224 entry = CMakeCacheEntry.from_line(line, line_no)
227 self._entries = OrderedDict((e.name, e) for e in entries)
229 def get(self, name, default=None): argument
230 entry = self._entries.get(name)
236 def get_list(self, name, default=None): argument
239 entry = self._entries.get(name)
252 def __contains__(self, name): argument
253 return name in self._entries
255 def __getitem__(self, name): argument
256 return self._entries[name].value
258 def __setitem__(self, name, entry): argument
262 self._entries[name] = entry
264 def __delitem__(self, name): argument
265 del self._entries[name]
271 cmd = [cmake, '--version']
280 decoded = version_out.decode('utf-8')
284 'unexpected "cmake --version" output:\n{}\n'.
289 if '-' in version:
290 # Handle semver cases like "3.19.20210206-g1e50ab6"
292 version = version.split('-', 1)[0]