authorgravatar for sin-ack@protonmail.comsin-ack <sin-ack@protonmail.com> 2024-08-07 13:30:39+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-08 17:42:11-07:00
log2cfad202045632945b5007e1d42c2f8a326be44a
tree9851f96248eb1f4b704996917c7c4572c5f3c6f3
parenta9b65b6fd4021b6b303b6a4d35cfaba56aac0c32

Compilation: Mark .c++ files as having C++ extension

Some projects, such as Cap'n Proto, use .c++ as their filenames. Without this, compiling them fails because zig c++ will fall back to using the linker.

2 files changed, 22 insertions(+), 21 deletions(-)

src/Compilation.zig+1
...@@ -6095,6 +6095,7 @@ pub fn hasCppExt(filename: []const u8) bool {...@@ -6095,6 +6095,7 @@ pub fn hasCppExt(filename: []const u8) bool {
6095 mem.endsWith(u8, filename, ".cc") or6095 mem.endsWith(u8, filename, ".cc") or
6096 mem.endsWith(u8, filename, ".cpp") or6096 mem.endsWith(u8, filename, ".cpp") or
6097 mem.endsWith(u8, filename, ".cxx") or6097 mem.endsWith(u8, filename, ".cxx") or
6098 mem.endsWith(u8, filename, ".c++") or
6098 mem.endsWith(u8, filename, ".stub");6099 mem.endsWith(u8, filename, ".stub");
6099}6100}
61006101
src/main.zig+21-21
...@@ -387,27 +387,27 @@ const usage_build_generic =...@@ -387,27 +387,27 @@ const usage_build_generic =
387 \\ zig translate-c [options] [file]387 \\ zig translate-c [options] [file]
388 \\388 \\
389 \\Supported file types:389 \\Supported file types:
390 \\ .zig Zig source code390 \\ .zig Zig source code
391 \\ .o ELF object file391 \\ .o ELF object file
392 \\ .o Mach-O (macOS) object file392 \\ .o Mach-O (macOS) object file
393 \\ .o WebAssembly object file393 \\ .o WebAssembly object file
394 \\ .obj COFF (Windows) object file394 \\ .obj COFF (Windows) object file
395 \\ .lib COFF (Windows) static library395 \\ .lib COFF (Windows) static library
396 \\ .a ELF static library396 \\ .a ELF static library
397 \\ .a Mach-O (macOS) static library397 \\ .a Mach-O (macOS) static library
398 \\ .a WebAssembly static library398 \\ .a WebAssembly static library
399 \\ .so ELF shared object (dynamic link)399 \\ .so ELF shared object (dynamic link)
400 \\ .dll Windows Dynamic Link Library400 \\ .dll Windows Dynamic Link Library
401 \\ .dylib Mach-O (macOS) dynamic library401 \\ .dylib Mach-O (macOS) dynamic library
402 \\ .tbd (macOS) text-based dylib definition402 \\ .tbd (macOS) text-based dylib definition
403 \\ .s Target-specific assembly source code403 \\ .s Target-specific assembly source code
404 \\ .S Assembly with C preprocessor (requires LLVM extensions)404 \\ .S Assembly with C preprocessor (requires LLVM extensions)
405 \\ .c C source code (requires LLVM extensions)405 \\ .c C source code (requires LLVM extensions)
406 \\ .cxx .cc .C .cpp .stub C++ source code (requires LLVM extensions)406 \\ .cxx .cc .C .cpp .c++ .stub C++ source code (requires LLVM extensions)
407 \\ .m Objective-C source code (requires LLVM extensions)407 \\ .m Objective-C source code (requires LLVM extensions)
408 \\ .mm Objective-C++ source code (requires LLVM extensions)408 \\ .mm Objective-C++ source code (requires LLVM extensions)
409 \\ .bc LLVM IR Module (requires LLVM extensions)409 \\ .bc LLVM IR Module (requires LLVM extensions)
410 \\ .cu Cuda source code (requires LLVM extensions)410 \\ .cu Cuda source code (requires LLVM extensions)
411 \\411 \\
412 \\General Options:412 \\General Options:
413 \\ -h, --help Print this help and exit413 \\ -h, --help Print this help and exit