MCPcopy Index your code
hub / github.com/nodejs/node / LoadTargetBuildFile

Function LoadTargetBuildFile

tools/gyp/pylib/gyp/input.py:362–497  ·  view source on GitHub ↗
(
    build_file_path,
    data,
    aux_data,
    variables,
    includes,
    depth,
    check,
    load_dependencies,
)

Source from the content-addressed store, hash-verified

360# a build file that contains targets and is expected to provide a targets dict
361# that contains the targets...
362def LoadTargetBuildFile(
363 build_file_path,
364 data,
365 aux_data,
366 variables,
367 includes,
368 depth,
369 check,
370 load_dependencies,
371):
372 # If depth is set, predefine the DEPTH variable to be a relative path from
373 # this build file's directory to the directory identified by depth.
374 if depth:
375 # TODO(dglazkov) The backslash/forward-slash replacement at the end is a
376 # temporary measure. This should really be addressed by keeping all paths
377 # in POSIX until actual project generation.
378 d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path))
379 if d == "":
380 variables["DEPTH"] = "."
381 else:
382 variables["DEPTH"] = d.replace("\\", "/")
383
384 # The 'target_build_files' key is only set when loading target build files in
385 # the non-parallel code path, where LoadTargetBuildFile is called
386 # recursively. In the parallel code path, we don't need to check whether the
387 # |build_file_path| has already been loaded, because the 'scheduled' set in
388 # ParallelState guarantees that we never load the same |build_file_path|
389 # twice.
390 if "target_build_files" in data:
391 if build_file_path in data["target_build_files"]:
392 # Already loaded.
393 return False
394 data["target_build_files"].add(build_file_path)
395
396 gyp.DebugOutput(
397 gyp.DEBUG_INCLUDES, "Loading Target Build File '%s'", build_file_path
398 )
399
400 build_file_data = LoadOneBuildFile(
401 build_file_path, data, aux_data, includes, True, check
402 )
403
404 # Store DEPTH for later use in generators.
405 build_file_data["_DEPTH"] = depth
406
407 # Set up the included_files key indicating which .gyp files contributed to
408 # this target dict.
409 if "included_files" in build_file_data:
410 raise GypError(build_file_path + " must not contain included_files key")
411
412 included = GetIncludedBuildFiles(build_file_path, aux_data)
413 build_file_data["included_files"] = []
414 for included_file in included:
415 # included_file is relative to the current directory, but it needs to
416 # be made relative to build_file_path's directory.
417 included_relative = gyp.common.RelativePath(
418 included_file, os.path.dirname(build_file_path)
419 )

Callers 2

CallLoadTargetBuildFileFunction · 0.85
LoadFunction · 0.85

Calls 8

GypErrorClass · 0.90
LoadOneBuildFileFunction · 0.85
GetIncludedBuildFilesFunction · 0.85
ProcessToolsetsInDictFunction · 0.85
MergeDictsFunction · 0.85
addMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…