[m-rev.] diff: fix a bug that broke mmc --make

Julien Fischer jfischer at opturion.com
Fri Oct 16 11:50:15 AEDT 2015



Fix a bug that broke mmc --make.

The recent shift of the mode of operation into the globals structure also
shifted the point at which the mode of operation is computed to *before* we
have dealt with any implications among the option set.  In particular,
computing the mode of operation did not take the effect of the
'--invoked-by-mmc-make' on the '--make' option into account.

compiler/op_mode.m:
      Account for the value of '--invoked-by-mmc-make' when computing the
      mode of operation.

Julien.

diff --git a/compiler/op_mode.m b/compiler/op_mode.m
index cbdd479..bede707 100644
--- a/compiler/op_mode.m
+++ b/compiler/op_mode.m
@@ -141,6 +141,17 @@ decide_op_mode(OptionTable, OpMode, OtherOpModes) :-
              unexpected($module, $pred,
                  "generate_standalone_interface is not maybe_string")
          ),
+
+        % The option `--invoked-by-mmc-make' implicitly disables `--make'.
+        %
+        getopt_io.lookup_bool_option(OptionTable, invoked_by_mmc_make,
+            InvokedByMMCMake),
+        (
+            InvokedByMMCMake = yes,
+            set.delete(opm_top_make, !OpModeSet)
+        ;
+            InvokedByMMCMake = no
+        ),
          set.to_sorted_list(!.OpModeSet, OpModes0),
          (
              OpModes0 = [],



More information about the reviews mailing list