aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/Compile.zig
AgeCommit message (Collapse)Author
2023-08-01CLI: stop special-casing LLVM, LLD, and ClangAndrew Kelley
Before: -fLLVM, -fLLD, -fClang, -flibLLVM -fno-LLVM, -fno-LLD, -fno-Clang, -fno-libLLVM After: -fllvm, -flld, -fclang, -flibllvm -fno-llvm, -fno-lld, -fno-clang, -fno-libllvm
2023-07-30build system: follow-up enhancements regarding LazyPathAndrew Kelley
* introduce LazyPath.cwd_relative variant and use it for --zig-lib-dir. closes #12685 * move overrideZigLibDir and setMainPkgPath to options fields set once and then never mutated. * avoid introducing Build/util.zig * use doc comments for deprecation notices so that they show up in generated documentation. * introduce InstallArtifact.Options, accept it as a parameter to addInstallArtifact, and move override_dest_dir into it. Instead of configuring the installation via Compile step, configure the installation via the InstallArtifact step. In retrospect this is obvious. * remove calls to pushInstalledFile in InstallArtifact. See #14943 * rewrite InstallArtifact to not incorrectly observe whether a Compile step has any generated outputs. InstallArtifact is meant to trigger output generation. * fix child process evaluation code handling of `-fno-emit-bin`. * don't store out_h_filename, out_ll_filename, etc., pointlessly. these are all just simple extensions appended to the root name. * make emit_directory optional. It's possible to have nothing outputted, for example, if you're just type-checking. * avoid passing -femit-foo/-fno-emit-foo when it is the default * rename ConfigHeader.getTemplate to getOutput * deprecate addOptionArtifact * update the random number seed of Options step caching. * avoid using `inline for` pointlessly * avoid using `override_Dest_dir` pointlessly * avoid emitting an executable pointlessly in test cases Removes forceBuild and forceEmit. Let's consider these additions separately. Nearly all of the usage sites were suspicious.
2023-07-30Tries to fix Windows DLL linking.Felix "xq" Queißner
2023-07-30Introduces Compile.forceBuild() and Compile.forceEmit(…)Felix "xq" Queißner
2023-07-30Introduces `Compile.getEmittedX()` functions, drops `Compile.emit_X`. ↵Felix (xq) Queißner
Resolves #14971
2023-07-30Build.zig rename orgy (aka: #16353). Renames FileSource to LazyPath and ↵Felix (xq) Queißner
removes functions that take literal paths instead of LazyPath.
2023-07-24std.Build.Step.Compile: getEmittedDocs API enhancementsAndrew Kelley
* Allow calling it multiple times. * Rename it. Sorry, this is to coincide with #16353.
2023-07-24CLI: delete dead option -femit-analysisAndrew Kelley
This used to do something with the old autodocs system. Now it does nothing.
2023-07-23test: test for issues starting codegen on many targetsJacob Young
Specifically this is to make sure llvm data layout generation doesn't regress. The no emit bin is to allow testing targets that can't currently be linked. The commented out targets are ones that fail in the linker anyway when no emit bin is passed.
2023-07-22move installation logic to the build script where it belongsAndrew Kelley
* build.zig: introduce `-Dflat` option which makes the installation match what we want to ship for our download tarballs. This allows deleting a bunch of shell script logic from the CI. - for example it puts the executable directly in prefix/zig rather than prefix/bin/zig and it additionally includes prefix/LICENSE. * build.zig: by default also install std lib documentation to doc/std/ - this can be disabled by `-Dno-autodocs` similar to how there is already `-Dno-langref`. * build.zig: add `std-docs` and `langref` steps which build and install the std lib autodocs and langref to prefix/doc/std and prefix/doc/langref.html, respectively. * std.Build: implement proper handling of `-femit-docs` using the LazyPath system. This is a breaking change. - this is a partial implementation of #16351 * frontend: fixed the handling of Autodocs with regards to caching and putting the artifacts in the proper location to integrate with the build system. - closes #15864 * CI: delete the logic for autodocs since it is now handled by build.zig and is enabled by default. - in the future we should strive to have nearly all the CI shell script logic deleted in favor of `zig build` commands. * CI: pass `-DZIG_NO_LIB=ON`/`-Dno-lib` except for the one command where we want to actually generate the langref and autodocs. Generating the langref takes 14 minutes right now (why?!) so we don't want to do that more times than necessary. * Autodoc: fixed use of a global variable. It works fine as a local variable instead. - note that in the future we will want to make Autodoc run simultaneously using the job system, but for now the principle of YAGNI dictates that we don't have an init()/deinit() API and instead simply call the function that does the things. * Autodoc: only do it when there are no compile errors
2023-07-19test/link: add shared-memory test for WebAssemblyLuuk de Gram
2023-07-11build: avoid repeating objects when linking a static libraryXavier Bouchoux
Don't pass the object files from a static library to the linker invocation. The lib.a file already contains them. Avoids "duplicate symbol" errors (and useless work by the linker)
2023-07-04std.Build.Step.Compile: fix clearing logic for empty cflagsAndrew Kelley
Commit c0b774fbc65e3e406a38d37b02fffda7c5d3df26 originally added this logic but it did not properly clear the C command line flags to empty when a previous positional argument had command line flags, because it never set the "previous" flag to true. This fixes C compiler flags not being reset to empty when using the build system and a second positional argument has no arguments after a first positional argument has arguments. Thanks to @squeek502 for finding this.
2023-06-26Build: make `InstallDirStep` use a `FileSource`Ian Johnson
Closes #16187
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-17std: replace builtin.Version with SemanticVersionr00ster91
2023-06-13std.Build.Step.Compile: remove `addSystemIncludeDir`, `addIncludeDir`, ↵Eric Joldasov
`addLibPath`, and `addFrameworkDir` (deprecated in 0.10) Followup to d3d24874c91054a70c706fed47278c81c9ce890a. Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-03Merge pull request #15579 from squeek502/mem-delimitersAndrew Kelley
Split `std.mem.split` and `tokenize` into `sequence`, `any`, and `scalar` versions
2023-06-03Build: fix producesPdbFile logic (#15756)xEgoist
Fixes bug causing ReleaseSmall to fail on Windows. Due to the change in default behavior of ReleaseSmall, debug info are stripped by default. However because `Compile.create` still defaults to null, `producesPdbFile` will report true for `lib/std/Build/Step/InstallArtifact.zig` causing it to fail on copying a file that does not exist. This commit change the default of strip depending on `optimize`.
2023-05-16tweaks to --build-idAndrew Kelley
* build.zig: the result of b.option() can be assigned directly in many cases thanks to the return type being an optional * std.Build: make the build system aware of the std.Build.Step.Compile.BuildId type when used as an option. - remove extraneous newlines in error logs * simplify caching logic * simplify hexstring parsing tests and use a doc test * simplify hashing logic. don't use an optional when the `none` tag already provides this meaning. * CLI: fix incorrect linker arg parsing
2023-05-16stage2: implement --build-id stylesMotiejus Jakštys
2023-05-13Update all std.mem.split calls to their appropriate functionRyan Liptak
Everywhere that can now use `splitScalar` should get a nice little performance boost.
2023-05-13Update all std.mem.tokenize calls to their appropriate functionRyan Liptak
Everywhere that can now use `tokenizeScalar` should get a nice little performance boost.
2023-05-03std.Build: use Step.* instead of *StepVeikka Tuominen
Follow up to 13eb7251d37759bd47403db304c6120c706fe353
2023-05-03build: rename std.Build.*Step to std.Build.Step.*Nicolas Sterchele
Follow-up actions from #14647 Fixes #14947