Skip to content

Commit 4d2362d

Browse files
erozenfeldmarek-safar
authored andcommitted
Add a switch to specify action on user assemblies.
Add -u switch to specify action on user (non-core) assemblies similar to -c switch for core assemblies.
1 parent 7904df9 commit 4d2362d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

linker/Mono.Linker/Driver.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ void Run ()
120120
case 'c':
121121
context.CoreAction = ParseAssemblyAction (GetParam ());
122122
break;
123+
case 'u':
124+
context.UserAction = ParseAssemblyAction (GetParam ());
125+
break;
123126
case 'p':
124127
AssemblyAction action = ParseAssemblyAction (GetParam ());
125128
context.Actions [GetParam ()] = action;
@@ -275,6 +278,7 @@ static LinkContext GetDefaultContext (Pipeline pipeline)
275278
{
276279
LinkContext context = new LinkContext (pipeline);
277280
context.CoreAction = AssemblyAction.Skip;
281+
context.UserAction = AssemblyAction.Link;
278282
context.OutputDirectory = "output";
279283
return context;
280284
}
@@ -294,6 +298,7 @@ static void Usage (string msg)
294298
Console.WriteLine (" --version Print the version number of the {0}", _linker);
295299
Console.WriteLine (" -out Specify the output directory, default to `output'");
296300
Console.WriteLine (" -c Action on the core assemblies, skip, copy or link, default to skip");
301+
Console.WriteLine(" -u Action on the user assemblies, skip, copy or link, default to link");
297302
Console.WriteLine (" -p Action per assembly");
298303
Console.WriteLine (" -s Add a new step to the pipeline.");
299304
Console.WriteLine (" -t Keep assemblies in which only type forwarders are referenced.");

linker/Mono.Linker/LinkContext.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class LinkContext : IDisposable {
3838

3939
Pipeline _pipeline;
4040
AssemblyAction _coreAction;
41+
AssemblyAction _userAction;
4142
Dictionary<string, AssemblyAction> _actions;
4243
string _outputDirectory;
4344
readonly Dictionary<string, string> _parameters;
@@ -71,6 +72,11 @@ public AssemblyAction CoreAction {
7172
set { _coreAction = value; }
7273
}
7374

75+
public AssemblyAction UserAction {
76+
get { return _userAction; }
77+
set { _userAction = value; }
78+
}
79+
7480
public bool LinkSymbols {
7581
get { return _linkSymbols; }
7682
set { _linkSymbols = value; }
@@ -247,7 +253,7 @@ protected void SetAction (AssemblyDefinition assembly)
247253
} else if (IsCore (name)) {
248254
action = _coreAction;
249255
} else {
250-
action = AssemblyAction.Link;
256+
action = _userAction;
251257
}
252258

253259
_annotations.SetAction (assembly, action);

0 commit comments

Comments
 (0)