MCPcopy Create free account
hub / github.com/boostorg/build / load_config

Function load_config

v2/build_system.py:176–212  ·  view source on GitHub ↗
(module_name, filename, paths, must_find=False)

Source from the content-addressed store, hash-verified

174# configuration file or nothing if no file was loaded.
175#
176def load_config(module_name, filename, paths, must_find=False):
177
178 if debug_config:
179 print "notice: Searching '%s' for '%s' configuration file '%s." \
180 % (paths, module_name, filename)
181
182 where = None
183 for path in paths:
184 t = os.path.join(path, filename)
185 if os.path.exists(t):
186 where = t
187 break
188
189 if where:
190 where = os.path.realpath(where)
191
192 if debug_config:
193 print "notice: Loading '%s' configuration file '%s' from '%s'." \
194 % (module_name, filename, where)
195
196 # Set source location so that path-constant in config files
197 # with relative paths work. This is of most importance
198 # for project-config.jam, but may be used in other
199 # config files as well.
200 attributes = get_manager().projects().attributes(module_name) ;
201 attributes.set('source-location', os.path.dirname(where), True)
202 get_manager().projects().load_standalone(module_name, where)
203
204 else:
205 msg = "Configuration file '%s' not found in '%s'." % (filename, path)
206 if must_find:
207 get_manager().errors()(msg)
208
209 elif debug_config:
210 print msg
211
212 return where
213
214# Loads all the configuration files used by Boost Build in the following order:
215#

Callers 1

load_configuration_filesFunction · 0.85

Calls 4

get_managerFunction · 0.90
projectsMethod · 0.80
setMethod · 0.80
errorsMethod · 0.80

Tested by

no test coverage detected