aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
AgeCommit message (Collapse)Author
2023-02-13std.Build.Cache: remove debug log statementsAndrew Kelley
Now that this API is used by the build system, these debug logs are problematic because build scripts run in debug mode, making these logs noisy output.
2023-02-13move the cache system from compiler to std libAndrew Kelley
2023-02-13std.Build.RunStep: introduce addOutputFileArg APIAndrew Kelley
This provides file path as a command line argument to the command being run, and returns a FileSource which can be used as inputs to other APIs throughout the build system. Unfortunately, it is implemented by pooping a ton of temporary files into zig-cache/tmp for the time being. I think one of the very next improvements to the build system should be moving the compiler's cache system to the standard library and using it in the build system. I had a look at the dependencies and it is already pretty untangled.
2023-02-13std.Build.ConfigHeaderStep: support outputting assembly config filesAndrew Kelley
2023-02-13std.Build: support running build artifacts from packagesAndrew Kelley
Deprecate CompileStep.run. The problem with this function is that it does the RunStep with the same build.zig context as the CompileStep, but this is not desirable when running an executable that is provided by a dependency package. Instead, users should use `b.addRunArtifact`. This has the additional benefit of conforming to the existing naming conventions. Additionally, support enum literals in config header options values.
2023-02-13std.Build.ConfigHeaderStep: support sentinel-terminated stringsAndrew Kelley
2023-02-05std.Build: enhancements to ConfigHeaderStepAndrew Kelley
Breaking API change to std.Build.addConfigHeader. It now uses an options struct. Introduce std.Build.CompileStep.installConfigHeader which also accepts an options struct. This is used to add a generated config file into the set of installed header files for a particular compilation artifact. std.Build.ConfigHeaderStep now additionally supports a "blank" style where a header is generated from scratch. It no longer exposes `output_dir`. Instead it exposes a FileSource via `output_file`. It now additionally accepts an `include_path` option which affects the include path of CompileStep when using the `#include` directive, as well as affecting the default installation subdirectory for header installation purposes. The hash used for the directory to store the generated config file now includes the contents of the generated file. This fixes possible race conditions when generating multiple header files simultaneously. The values hash table is now an array hash map, to preserve order for the "blank" use case. I also took the opportunity to remove output_dir from TranslateCStep and WriteFileStep. This is technically a breaking change, but it was always naughty to access these fields.
2023-02-05std.build: support for generated c headersDavid Vanderson
Add ability to generate a c header file from scratch, and then both compile with it and install it if needed. Example: ```zig const avconfig_h = b.addConfigHeader(.{ .path = "libavutil/avconfig.h" }, .generated, .{ .AV_HAVE_BIGENDIAN = 0, // TODO: detect based on target .AV_HAVE_FAST_UNALIGNED = 1, // TODO: detect based on target }); lib.addConfigHeader(avconfig_h); lib.installConfigHeader(avconfig_h); ```
2023-02-04std.Build: support exposing and depending on zig modulesAndrew Kelley
New API introduced: std.Build.addModule This function exposes a zig module with the given name, which can be used by packages that depend on this one via std.Build.Dependency.module. std.Build.Pkg and related functionality is deleted. Every use case has a straightforward upgrade path using the new Module struct. std.Build.OptionsStep.getPackage is replaced by std.Build.OptionsStep.createModule. std.Build.CompileStep.addPackagePath is replaced by std.Build.CompileStep.addAnonymousModule. This partially addresses #14307 by renaming some of the instances of "package" to "module". Closes #14278
2023-02-03introduce ZON: Zig Object NotationAndrew Kelley
* std.zig.parse is moved to std.zig.Ast.parse * the new function has an additional parameter that requires passing Mode.zig or Mode.zon * moved parser.zig code to Parse.zig * added parseZon function next to parseRoot function
2023-02-01remove reference to removed addTestExeKirk Scheibelhut
2023-01-31std.Build.CompileStep: fix API usage in unit testAndrew Kelley
2023-01-31std.Build.ConfigHeaderStep: support more typesAndrew Kelley
2023-01-31std.Build: avoid use of catch unreachableAndrew Kelley
Usage of `catch unreachable` in build scripts is completely harmless because build scripts are always run in Debug mode, however, it sets a poor example for beginners to learn from.
2023-01-31rename std.Build.LibExeObjStep to std.Build.CompileStepAndrew Kelley
This matches the nomenclature internally: a Compilation is the main type that represents a single invokation of the compiler.
2023-01-31std.Build: accept host Target in create()Andrew Kelley
And only detect native target in LibExeObjStep once, in create().
2023-01-31combine std.build and std.build.Builder into std.BuildAndrew Kelley
I've been wanting to do this for along time.