]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
Since like with parsing, the preprocessor state has to be preserved across files...
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 2db65f9f6e43b42e748c661c6a28e634c77d1a6d..d1ac7f12e46560dde15d5d94bd50e7dd23f9b733 100644 (file)
--- a/main.c
+++ b/main.c
@@ -436,6 +436,7 @@ int main(int argc, char **argv) {
     options_set(opts_warn, WARN_END_SYS_FIELDS, true);
     options_set(opts_warn, WARN_ASSIGN_FUNCTION_TYPES, true);
     options_set(opts_warn, WARN_PREPROCESSOR, true);
+    options_set(opts_warn, WARN_MULTIFILE_IF, true);
 
     options_set(opts_flags, ADJUST_VECTOR_FIELDS, true);
 
@@ -464,10 +465,19 @@ int main(int argc, char **argv) {
         con_out("standard = %i\n", opts_standard);
     }
 
-    if (!parser_init()) {
-        con_out("failed to initialize parser\n");
-        retval = 1;
-        goto cleanup;
+    if (!opts_pp_only) {
+        if (!parser_init()) {
+            con_err("failed to initialize parser\n");
+            retval = 1;
+            goto cleanup;
+        }
+    }
+    if (opts_pp_only || opts_standard == COMPILER_FTEQCC) {
+        if (!ftepp_init()) {
+            con_err("failed to initialize parser\n");
+            retval = 1;
+            goto cleanup;
+        }
     }
 
     util_debug("COM", "starting ...\n");