make
Function parameters
Parameters
- step:*Step
- options:Step.MakeOptions
Type definitions in this namespace
Types
Functions in this namespace
Functions
- installHeader
- Marks the specified header for installation alongside this artifact.
- installHeadersDirectory
- Marks headers from the specified directory for installation alongside this artifact.
- installConfigHeader
- Marks the specified config header for installation alongside this artifact.
- installLibraryHeaders
- Forwards all headers marked for installation from `lib` to this artifact.
- dependsOnSystemLibrary
- Returns whether the library, executable, or object depends on a particular system library.
- linkLibC
- Deprecated; use `compile.root_module.link_libc = true` instead.
- linkLibCpp
- Deprecated; use `compile.root_module.link_libcpp = true` instead.
- linkSystemLibrary
- Deprecated; use `compile.root_module.linkSystemLibrary(name, .{})` instead.
- linkSystemLibrary2
- Deprecated; use `compile.root_module.linkSystemLibrary(name, options)` instead.
- linkFramework
- Deprecated; use `c.root_module.linkFramework(name, .{})` instead.
- addCSourceFiles
- Deprecated; use `compile.root_module.addCSourceFiles(options)` instead.
- addCSourceFile
- Deprecated; use `compile.root_module.addCSourceFile(source)` instead.
- addWin32ResourceFile
- Deprecated; use `compile.root_module.addWin32ResourceFile(source)` instead.
- getEmittedBinDirectory
- Returns the path to the directory that contains the emitted binary file.
- getEmittedBin
- Returns the path to the generated executable, library or object file.
- getEmittedImplib
- Returns the path to the generated import library.
- getEmittedH
- Returns the path to the generated header file.
- getEmittedPdb
- Returns the generated PDB file.
- getEmittedDocs
- Returns the path to the generated documentation directory.
- getEmittedAsm
- Returns the path to the generated assembly code.
- getEmittedLlvmIr
- Returns the path to the generated LLVM IR.
- getEmittedLlvmBc
- Returns the path to the generated LLVM BC.
- addAssemblyFile
- Deprecated; use `compile.root_module.addAssemblyFile(source)` instead.
- addObjectFile
- Deprecated; use `compile.root_module.addObjectFile(source)` instead.
- addObject
- Deprecated; use `compile.root_module.addObject(object)` instead.
- linkLibrary
- Deprecated; use `compile.root_module.linkLibrary(library)` instead.
- addAfterIncludePath
- Deprecated; use `compile.root_module.addAfterIncludePath(lazy_path)` instead.
- addSystemIncludePath
- Deprecated; use `compile.root_module.addSystemIncludePath(lazy_path)` instead.
- addIncludePath
- Deprecated; use `compile.root_module.addIncludePath(lazy_path)` instead.
- addConfigHeader
- Deprecated; use `compile.root_module.addConfigHeader(config_header)` instead.
- addEmbedPath
- Deprecated; use `compile.root_module.addEmbedPath(lazy_path)` instead.
- addLibraryPath
- Deprecated; use `compile.root_module.addLibraryPath(directory_path)` instead.
- addRPath
- Deprecated; use `compile.root_module.addRPath(directory_path)` instead.
- addSystemFrameworkPath
- Deprecated; use `compile.root_module.addSystemFrameworkPath(directory_path)` instead.
- addFrameworkPath
- Deprecated; use `compile.root_module.addFrameworkPath(directory_path)` instead.
- getCompileDependencies
- Return the full set of `Step.Compile` which `start` depends on, recursively.
= .compile
Values
- base_id
- = .compile
Source
Implementation
fn make(step: *Step, options: Step.MakeOptions) !void {
const b = step.owner;
const compile: *Compile = @fieldParentPtr("step", step);
const zig_args = try getZigArgs(compile, false);
const maybe_output_dir = step.evalZigProcess(
zig_args,
options.progress_node,
(b.graph.incremental == true) and (options.watch or options.web_server != null),
options.web_server,
options.gpa,
) catch |err| switch (err) {
error.NeedCompileErrorCheck => {
assert(compile.expect_errors != null);
try checkCompileErrors(compile);
return;
},
else => |e| return e,
};
// Update generated files
if (maybe_output_dir) |output_dir| {
if (compile.emit_directory) |lp| {
lp.path = b.fmt("{f}", .{output_dir});
}
// zig fmt: off
if (compile.generated_bin) |lp| lp.path = compile.outputPath(output_dir, .bin);
if (compile.generated_pdb) |lp| lp.path = compile.outputPath(output_dir, .pdb);
if (compile.generated_implib) |lp| lp.path = compile.outputPath(output_dir, .implib);
if (compile.generated_h) |lp| lp.path = compile.outputPath(output_dir, .h);
if (compile.generated_docs) |lp| lp.path = compile.outputPath(output_dir, .docs);
if (compile.generated_asm) |lp| lp.path = compile.outputPath(output_dir, .@"asm");
if (compile.generated_llvm_ir) |lp| lp.path = compile.outputPath(output_dir, .llvm_ir);
if (compile.generated_llvm_bc) |lp| lp.path = compile.outputPath(output_dir, .llvm_bc);
// zig fmt: on
}
if (compile.kind == .lib and compile.linkage != null and compile.linkage.? == .dynamic and
compile.version != null and std.Build.wantSharedLibSymLinks(compile.rootModuleTarget()))
{
try doAtomicSymLinks(
step,
compile.getEmittedBin().getPath2(b, step),
compile.major_only_filename.?,
compile.name_only_filename.?,
);
}
}