aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/zig0.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-07 23:54:34 -0500
committerGitHub <noreply@github.com>2020-12-07 23:54:34 -0500
commita01d55e801c91b5f8b6beb1ae88640e16ffdf058 (patch)
tree59d121b5f2889bf99dae0d03fa9604a47cb68cd9 /src/stage1/zig0.cpp
parent5f7b97e84c7e2bc7682510e97996ad30147026d0 (diff)
parent1afea36a16ba4963f2a4ad0b2efb5e18680305ac (diff)
downloadzig-a01d55e801c91b5f8b6beb1ae88640e16ffdf058.tar.gz
zig-a01d55e801c91b5f8b6beb1ae88640e16ffdf058.zip
Merge pull request #7309 from ziglang/build-stage1-with-only-zig
ability to build stage1 using only a zig tarball
Diffstat (limited to 'src/stage1/zig0.cpp')
-rw-r--r--src/stage1/zig0.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/stage1/zig0.cpp b/src/stage1/zig0.cpp
index 6b55d97fac..73f5b4f685 100644
--- a/src/stage1/zig0.cpp
+++ b/src/stage1/zig0.cpp
@@ -18,6 +18,11 @@
#include "buffer.hpp"
#include "os.hpp"
+// This is the only file allowed to include config.h because config.h is
+// only produced when building with cmake. When using the zig build system,
+// zig0.cpp is never touched.
+#include "config.h"
+
#include <stdio.h>
#include <string.h>
@@ -537,3 +542,11 @@ const char *stage2_add_link_lib(struct ZigStage1 *stage1,
{
return nullptr;
}
+
+const char *stage2_version_string(void) {
+ return ZIG_VERSION_STRING;
+}
+
+struct Stage2SemVer stage2_version(void) {
+ return {ZIG_VERSION_MAJOR, ZIG_VERSION_MINOR, ZIG_VERSION_PATCH};
+}