aboutsummaryrefslogtreecommitdiff
path: root/cmake/install.cmake
AgeCommit message (Collapse)Author
2024-05-15CMake: try to fix CI failuresEric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2024-05-14CMake: clean `CMAKE_{SOURCE,BUILD}_DIR`Eric Joldasov
Replace `CMAKE_SOURCE_DIR` and `CMAKE_BUILD_DIR` with different variables, or in some cases just remove them. For some function arguments, prepended `CMAKE_SOURCE_DIR` was removed without replacement. This includes: * Sources for `add_library` and `add_executable` (`ZIG_CPP_SOURCES` and `ZIG_WASM2C_SOURCES`) * Inputs for `configure_file` and `target_include_directory` * For arguments above, CMake already prepends `CMAKE_CURRENT_SOURCE_DIR` to them by default, if they are relative paths. Additionaly, it was removed from arguments of commands that have `WORKING_DIRECTORY` set to `PROJECT_SOURCE_DIR`, they will be similarly converted by CMake for us. Also: * Move project declaration to the top so that these variables are available earlier. * Avoid calling "git" executable if ".git" directory does not exist. * Swap "--prefix" and `ZIG_BUILD_ARGS` arguments in cmake/install.cmake to match same "zig2 build" command in CMakeLists.txt and allow overriding "--prefix" argument Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
2022-10-18build: avoid compiling self-hosted twiceAndrew Kelley
build.zig: add a 'compile' step to compile the self-hosted compiler without installing it. Compilation: set cache mode to whole when using the LLVM backend and --enable-cache is passed. This makes `zig build` act the same as it does with stage1. Upside is that a second invocation of `zig build` on an unmodified source tree will avoid redoing the compilation again. Downside is that it will proliferate more garbage in the project-local cache (same as stage1). This can eventually be fixed when Zig's incremental compilation is more robust; we can go back to having LLVM use CacheMode.incremental and rely on it detecting no changes and avoiding doing the flush() step.
2022-10-18cmake: separate installing and building (again)Eric Joldasov
2022-08-28cmake: build stage3 by defaultAndrew Kelley
This is a simplification of the cmake build script which introduces a new "stage3" target that is built by default, which builds and installs a stage3 zig. It greatly simplifies the build instructions for Zig, making it conform to the regular cmake routine, while still producing a stage3 artifact.
2020-02-16rename libuserland to libstage2Andrew Kelley
2020-02-16remove libc dependency of zig0 building libstage2Andrew Kelley
Rather than `zig0 build ...` the build now does `zig0 build-lib ...`, avoiding the requirement of linking the build script, and thus avoiding the requirement of finding native libc, for systems where libc is the system ABI.
2020-01-17cmake: support `make` and `make install`Michael Dusan
(2nd attempt to get this right)