diff --git a/tools/mtouch/Application.cs b/tools/mtouch/Application.cs index 02172133dba7..dc1df7f391f9 100644 --- a/tools/mtouch/Application.cs +++ b/tools/mtouch/Application.cs @@ -957,16 +957,6 @@ void DetectCodeSharing () continue; } - if (Optimizations.RemoveDynamicRegistrar != appex.Optimizations.RemoveDynamicRegistrar) { - Func bool_tostr = (v) => { - if (!v.HasValue) - return "default"; - return v.Value ? "true" : "false"; - }; - ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the remove-dynamic-registrar optimization differ between the container app ({bool_tostr (appex.Optimizations.RemoveDynamicRegistrar)}) and the extension ({bool_tostr (Optimizations.RemoveDynamicRegistrar)})."); - continue; - } - bool applicable = true; // The --assembly-build-target arguments must be identical. // We can probably lift this requirement (at least partially) at some point, @@ -1056,6 +1046,17 @@ void DetectCodeSharing () } } + // Check that the remove-dynamic-registrar optimizations are identical + if (Optimizations.RemoveDynamicRegistrar != appex.Optimizations.RemoveDynamicRegistrar) { + Func bool_tostr = (v) => { + if (!v.HasValue) + return "default"; + return v.Value ? "true" : "false"; + }; + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the remove-dynamic-registrar optimization differ between the container app ({bool_tostr (appex.Optimizations.RemoveDynamicRegistrar)}) and the extension ({bool_tostr (Optimizations.RemoveDynamicRegistrar)})."); + continue; + } + // Check if there aren't referenced assemblies from different sources foreach (var target in Targets) { var appexTarget = appex.Targets.SingleOrDefault ((v) => v.Is32Build == target.Is32Build);