aboutsummaryrefslogtreecommitdiff
path: root/src/error.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-02-23 09:35:56 -0500
committerGitHub <noreply@github.com>2019-02-23 09:35:56 -0500
commit6fd8d455bcc6765e7411fa00d23dca1eb270aac9 (patch)
tree047a654678400140fd46ffa64d7c4248050247cd /src/error.cpp
parent52bb71867d8d6e738eefb7dafead875eb21a4ae7 (diff)
downloadzig-6fd8d455bcc6765e7411fa00d23dca1eb270aac9.tar.gz
zig-6fd8d455bcc6765e7411fa00d23dca1eb270aac9.zip
better libc detection (#1996)
* better libc detection This introduces a new command `zig libc` which prints the various paths of libc files. It outputs them to stdout in a simple text file format that it is capable of parsing. You can use `zig libc libc.txt` to validate a file. These arguments are gone: --libc-lib-dir [path] directory where libc crt1.o resides --libc-static-lib-dir [path] directory where libc crtbegin.o resides --msvc-lib-dir [path] (windows) directory where vcruntime.lib resides --kernel32-lib-dir [path] (windows) directory where kernel32.lib resides Instead we have this argument: --libc [file] Provide a file which specifies libc paths This is used to pass a libc text file (which can be generated with `zig libc`). So it is easier to manage multiple cross compilation environments. `--cache on` now works when linking against libc. `ZigTarget` now has a bool field `is_native` Better error messaging when you try to link against libc or use `@cImport` but the various paths cannot be found. It should also be faster. * save native_libc.txt in zig-cache This avoids having to detect libc at runtime on every invocation.
Diffstat (limited to 'src/error.cpp')
-rw-r--r--src/error.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/error.cpp b/src/error.cpp
index 10186fbde5..9e01a86d8c 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -34,6 +34,8 @@ const char *err_str(Error err) {
case ErrorPipeBusy: return "pipe busy";
case ErrorPrimitiveTypeNotFound: return "primitive type not found";
case ErrorCacheUnavailable: return "cache unavailable";
+ case ErrorPathTooLong: return "path too long";
+ case ErrorCCompilerCannotFindFile: return "C compiler cannot find file";
}
return "(invalid error)";
}