18
18
19
19
#include "library-builder.h"
20
20
21
+ #if defined(BUNDLED_ASSEMBLIES )
22
+
23
+ static void
24
+ cleanup_runtime_config (MonovmRuntimeConfigArguments * args , void * user_data )
25
+ {
26
+ free (args );
27
+ free (user_data );
28
+ }
29
+
30
+ static void
31
+ initialize_runtimeconfig ()
32
+ {
33
+ MonovmRuntimeConfigArguments * arg = (MonovmRuntimeConfigArguments * )malloc (sizeof (MonovmRuntimeConfigArguments ));
34
+ if (!arg )
35
+ LOG_ERROR ("Out of memory.\n" );
36
+
37
+ arg -> kind = 1 ;
38
+ const char * data ;
39
+ int data_len ;
40
+ mono_get_bundled_assembly ("runtimeconfig.bin" , & data , & data_len );
41
+ arg -> runtimeconfig .data .data = data ;
42
+ arg -> runtimeconfig .data .data_len = data_len ;
43
+ monovm_runtimeconfig_initialize (arg , cleanup_runtime_config , NULL );
44
+ }
45
+
46
+ #else
47
+
21
48
static void
22
49
cleanup_runtime_config (MonovmRuntimeConfigArguments * args , void * user_data )
23
50
{
@@ -54,6 +81,8 @@ initialize_runtimeconfig (const char *bundle_path)
54
81
}
55
82
}
56
83
84
+ #endif // BUNDLED_ASSEMBLIES
85
+
57
86
static void
58
87
initialize_appctx_env_variables (const char * bundle_path )
59
88
{
@@ -110,6 +139,13 @@ free_aot_data (MonoAssembly *assembly, int size, void *user_data, void *handle)
110
139
static void
111
140
runtime_init_callback ()
112
141
{
142
+ register_aot_modules ();
143
+
144
+ #if defined(BUNDLED_ASSEMBLIES )
145
+ mono_register_assemblies_bundle ();
146
+ mono_register_bundle ();
147
+ #endif
148
+
113
149
const char * assemblies_location = getenv ("%ASSEMBLIES_LOCATION%" );
114
150
if (!assemblies_location || assemblies_location [0 ] == '\0' )
115
151
assemblies_location = "./" ;
@@ -123,13 +159,6 @@ runtime_init_callback ()
123
159
124
160
initialize_appctx_env_variables (bundle_path );
125
161
126
- register_aot_modules ();
127
-
128
- #if defined(BUNDLED_ASSEMBLIES )
129
- mono_register_assemblies_bundle ();
130
- mono_register_bundle ();
131
- #endif
132
-
133
162
mono_set_assemblies_path (bundle_path );
134
163
135
164
mono_jit_set_aot_only (true);
0 commit comments