zig/tools
Motiejus Jakštys 6b3f59c3a7 zig run/cc: recognize "-x language"
This commit adds support for "-x language" for a couple of hand-picked
supported languages. There is no reason the list of supported languages
to not grow (e.g. add "c-header"), but I'd like to keep it small at the
start.

Alternative 1
-------------

I first tried to add a new type "Language", and then add that to the
`CSourceFile`. But oh boy what a change it turns out to be. So I am
keeping myself tied to FileExt and see what you folks think.

Alternative 2
-------------

I tried adding `Language: ?[]const u8` to `CSourceFile`. However, the
language/ext, whatever we want to call it, still needs to be interpreted
in the main loop: one kind of handling for source files, other kind of
handling for everything else.

Test case
---------

*standalone.c*

    #include <iostream>

    int main() {
        std::cout << "elho\n";
    }

Compile and run:

    $ ./zig run -x c++ -lc++ standalone.c
    elho
    $ ./zig c++ -x c++ standalone.c -o standalone && ./standalone
    elho

Fixes #10915
2023-01-13 21:38:11 -05:00
..
spirv SPIR-V: Split out registry from gen_spirv_spec.zig 2021-05-14 19:49:32 +02:00
extract-grammar.zig tools: build all tools in ci to prevent bitrot 2023-01-06 01:18:46 +02:00
gen_outline_atomics.zig outline atomics: ret instead of jump to ret 2022-11-21 17:17:02 -07:00
gen_spirv_spec.zig spirv: assembler 2022-11-23 19:17:58 +01:00
gen_stubs.zig tools: build all tools in ci to prevent bitrot 2023-01-06 01:18:46 +02:00
generate_linux_syscalls.zig Generate linux syscalls via. the linux source tree 2022-05-16 23:55:11 -04:00
process_headers.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
stage1_gdb_pretty_printers.py gdb: restructure pretty printers into different files 2022-03-16 18:13:10 +01:00
stage2_gdb_pretty_printers.py add -fopt-bisect-limit 2023-01-03 13:05:09 +02:00
stage2_lldb_pretty_printers.py tools: add lldb stage2 pretty printers 2022-10-17 07:55:28 -04:00
stage2_pretty_printers_common.py tools: add lldb stage2 pretty printers 2022-10-17 07:55:28 -04:00
std_gdb_pretty_printers.py gdb: restructure pretty printers into different files 2022-03-16 18:13:10 +01:00
update_clang_options.zig zig run/cc: recognize "-x language" 2023-01-13 21:38:11 -05:00
update_cpu_features.zig add m68k target CPU features 2022-10-20 09:21:06 -07:00
update_glibc.zig std.fs: split Dir into IterableDir 2022-07-15 13:04:21 +03:00
update_spirv_features.zig adapt update_spriv_features to changed std pattern 2022-11-23 19:17:58 +01:00
update-license-headers.zig std.fs: split Dir into IterableDir 2022-07-15 13:04:21 +03:00
update-linux-headers.zig std.fs: split Dir into IterableDir 2022-07-15 13:04:21 +03:00
zig_gdb_pretty_printers.py gdb: restructure pretty printers into different files 2022-03-16 18:13:10 +01:00