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 {
60956095 mem.endsWith(u8, filename, ".cc") or
60966096 mem.endsWith(u8, filename, ".cpp") or
60976097 mem.endsWith(u8, filename, ".cxx") or
6098 mem.endsWith(u8, filename, ".c++") or
60986099 mem.endsWith(u8, filename, ".stub");
60996100}
61006101
src/main.zig+21-21
......@@ -387,27 +387,27 @@ const usage_build_generic =
387387 \\ zig translate-c [options] [file]
388388 \\
389389 \\Supported file types:
390 \\ .zig Zig source code
391 \\ .o ELF object file
392 \\ .o Mach-O (macOS) object file
393 \\ .o WebAssembly object file
394 \\ .obj COFF (Windows) object file
395 \\ .lib COFF (Windows) static library
396 \\ .a ELF static library
397 \\ .a Mach-O (macOS) static library
398 \\ .a WebAssembly static library
399 \\ .so ELF shared object (dynamic link)
400 \\ .dll Windows Dynamic Link Library
401 \\ .dylib Mach-O (macOS) dynamic library
402 \\ .tbd (macOS) text-based dylib definition
403 \\ .s Target-specific assembly source code
404 \\ .S Assembly with C preprocessor (requires LLVM extensions)
405 \\ .c C source code (requires LLVM extensions)
406 \\ .cxx .cc .C .cpp .stub C++ source code (requires LLVM extensions)
407 \\ .m Objective-C source code (requires LLVM extensions)
408 \\ .mm Objective-C++ source code (requires LLVM extensions)
409 \\ .bc LLVM IR Module (requires LLVM extensions)
410 \\ .cu Cuda source code (requires LLVM extensions)
390 \\ .zig Zig source code
391 \\ .o ELF object file
392 \\ .o Mach-O (macOS) object file
393 \\ .o WebAssembly object file
394 \\ .obj COFF (Windows) object file
395 \\ .lib COFF (Windows) static library
396 \\ .a ELF static library
397 \\ .a Mach-O (macOS) static library
398 \\ .a WebAssembly static library
399 \\ .so ELF shared object (dynamic link)
400 \\ .dll Windows Dynamic Link Library
401 \\ .dylib Mach-O (macOS) dynamic library
402 \\ .tbd (macOS) text-based dylib definition
403 \\ .s Target-specific assembly source code
404 \\ .S Assembly with C preprocessor (requires LLVM extensions)
405 \\ .c 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)
408 \\ .mm Objective-C++ source code (requires LLVM extensions)
409 \\ .bc LLVM IR Module (requires LLVM extensions)
410 \\ .cu Cuda source code (requires LLVM extensions)
411411 \\
412412 \\General Options:
413413 \\ -h, --help Print this help and exit