@@ -1617,6 +1617,7 @@ mini_usage (void)
1617
1617
#endif
1618
1618
" --handlers Install custom handlers, use --help-handlers for details.\n"
1619
1619
" --aot-path=PATH List of additional directories to search for AOT images.\n"
1620
+ " --path=DIR Add DIR to the list of directories to search for assemblies.\n"
1620
1621
);
1621
1622
1622
1623
g_print ("\nOptions:\n" );
@@ -2069,6 +2070,7 @@ mono_main (int argc, char* argv[])
2069
2070
char * aot_options = NULL ;
2070
2071
GPtrArray * agents = NULL ;
2071
2072
char * extra_bindings_config_file = NULL ;
2073
+ GList * paths = NULL ;
2072
2074
#ifdef MONO_JIT_INFO_TABLE_TEST
2073
2075
int test_jit_info_table = FALSE;
2074
2076
#endif
@@ -2294,6 +2296,8 @@ mono_main (int argc, char* argv[])
2294
2296
g_free (tmp );
2295
2297
split ++ ;
2296
2298
}
2299
+ } else if (strncmp (argv [i ], "--path=" , 7 ) == 0 ) {
2300
+ paths = g_list_append (paths , argv [i ] + 7 );
2297
2301
} else if (strncmp (argv [i ], "--compile-all=" , 14 ) == 0 ) {
2298
2302
action = DO_COMPILE ;
2299
2303
recompilation_times = atoi (argv [i ] + 14 );
@@ -2503,6 +2507,16 @@ mono_main (int argc, char* argv[])
2503
2507
if (g_hasenv ("MONO_XDEBUG" ))
2504
2508
enable_debugging = TRUE;
2505
2509
2510
+ if (paths ) {
2511
+ char * * p = g_new0 (char * , g_list_length (paths ) + 1 );
2512
+ int pindex = 0 ;
2513
+ for (GList * l = paths ; l ; l = l -> next )
2514
+ p [pindex ++ ] = (char * )l -> data ;
2515
+ g_list_free (paths );
2516
+
2517
+ mono_set_assemblies_path_direct (p );
2518
+ }
2519
+
2506
2520
#ifdef MONO_CROSS_COMPILE
2507
2521
if (!mono_compile_aot ) {
2508
2522
fprintf (stderr , "This mono runtime is compiled for cross-compiling. Only the --aot option is supported.\n" );
0 commit comments