Skip to content

Commit 2f2eb81

Browse files
committed
[WIP] System properties
1 parent 251297f commit 2f2eb81

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Xamarin.Android.Build.Tasks/Utilities/NativeAotEnvironmentNativeAssemblyGenerator.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ protected override void Construct (LlvmIrModule module)
2828
SortedDictionary<string, string>? systemProperties = null;
2929
if (envBuilder.SystemProperties.Count > 0) {
3030
systemProperties = new (envBuilder.SystemProperties, StringComparer.Ordinal);
31+
} else {
32+
systemProperties = new (StringComparer.Ordinal);
3133
}
3234

3335
var envVarsBlob = new LlvmIrStringBlob ();
@@ -47,6 +49,12 @@ protected override void Construct (LlvmIrModule module)
4749
};
4850
module.Add (envVars);
4951
module.AddGlobalVariable ("__naot_android_app_environment_variable_contents", envVarsBlob, LlvmIrVariableOptions.GlobalConstant);
52+
53+
// Probably want'em to use blobs...
54+
var sysProps = new LlvmIrGlobalVariable (systemProperties, "__naot_android_app_system_properties") {
55+
Comment = " System properties defined by the application",
56+
};
57+
module.Add (sysProps, stringGroupName: "sysprop", stringGroupComment: " System properties name:value pairs");
5058
}
5159

5260
void MapStructures (LlvmIrModule module)

0 commit comments

Comments
 (0)