summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorZuhaitz <zuhaitz.zechhub@gmail.com>2026-01-31 17:22:17 +0000
committerGitHub <noreply@github.com>2026-01-31 17:22:17 +0000
commit962d659c61212b1a23acfe56dda7cb92b721feda (patch)
treeba1637d3885213095b312f81a477c33b1ebca6aa /src/main.c
parente521ee7d175393ef37579ebd61ccb7e8d56a397f (diff)
parent91ed9fdd65e09bd6cd32e44dd07c390f2cf79c22 (diff)
Merge branch 'main' into main
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index e2b3cde..f5d8c1b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -172,6 +172,10 @@ int main(int argc, char **argv)
g_config.use_cuda = 1;
g_config.use_cpp = 1; // CUDA implies C++ mode.
}
+ else if (strcmp(arg, "--objc") == 0)
+ {
+ g_config.use_objc = 1;
+ }
else if (strcmp(arg, "--check") == 0)
{
g_config.mode_check = 1;
@@ -304,6 +308,10 @@ int main(int argc, char **argv)
{
temp_source_file = "out.cpp";
}
+ else if (g_config.use_objc)
+ {
+ temp_source_file = "out.m";
+ }
// Codegen to C/C++/CUDA
FILE *out = fopen(temp_source_file, "w");
@@ -362,8 +370,9 @@ int main(int argc, char **argv)
// If using cosmocc, it handles these usually, but keeping them is okay for Linux targets
snprintf(cmd, sizeof(cmd), "%s %s %s %s %s -o %s %s %s %s -I./src %s", g_config.cc,
- g_config.gcc_flags, g_cflags, g_config.is_freestanding ? "-ffreestanding" : "", "",
- outfile, temp_source_file, math_flag, thread_flag, g_link_flags);
+ g_config.gcc_flags, g_cflags, g_config.is_freestanding ? "-ffreestanding" : "",
+ g_config.quiet ? "-w" : "", outfile, temp_source_file, math_flag, thread_flag,
+ g_link_flags);
if (g_config.verbose)
{