[qfcc] Actually skip compile for -E etc

The preprocess-only option wasn't being checked enough.
This commit is contained in:
Bill Currie 2023-03-06 13:06:05 +09:00
parent 119001de6f
commit 99af93c6e6

View file

@ -394,7 +394,7 @@ compile_to_obj (const char *file, const char *obj, lang_t lang)
}
*yyin = preprocess_file (file, 0);
if (!*yyin)
if (options.preprocess_only || !*yyin)
return !options.preprocess_only;
InitData ();
@ -568,7 +568,7 @@ separate_compile (void)
}
dstring_delete (output_file);
dstring_delete (extension);
if (!err && !options.compile) {
if (!err && !options.compile && !options.preprocess_only) {
InitData ();
chain_initial_types ();
linker_begin ();
@ -659,7 +659,7 @@ compile_file (const char *filename)
int (*yyparse) (void) = qc_yyparse;
*yyin = preprocess_file (filename, 0);
if (!*yyin)
if (options.preprocess_only || !*yyin)
return !options.preprocess_only;
add_source_file (filename);
@ -717,6 +717,9 @@ progs_src_compile (void)
exit (1);
}
}
if (options.preprocess_only) {
return 0;
}
src = load_file (filename->str);
if (!src) {