1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
7 // Get the path to entrypoint executable
8 bool GetEntrypointExecutableAbsolutePath(std::string
& entrypointExecutable
);
10 // Get absolute path from the specified path.
11 // Return true in case of a success, false otherwise.
12 bool GetAbsolutePath(const char* path
, std::string
& absolutePath
);
14 // Get directory of the specified path.
15 // Return true in case of a success, false otherwise.
16 bool GetDirectory(const char* absolutePath
, std::string
& directory
);
19 // Get the absolute path to use to locate libcoreclr.so and the CLR assemblies are stored. If clrFilesPath is provided,
20 // this function will return the absolute path to it. Otherwise, the directory of the current executable is used.
22 // Return true in case of a success, false otherwise.
24 bool GetClrFilesAbsolutePath(const char* currentExePath
, const char* clrFilesPath
, std::string
& clrFilesAbsolutePath
);
26 // Add all *.dll, *.ni.dll, *.exe, and *.ni.exe files from the specified directory to the tpaList string.
27 void AddFilesFromDirectoryToTpaList(const char* directory
, std::string
& tpaList
);
30 // Execute the specified managed assembly.
33 // currentExePath - Path to the current executable
34 // clrFilesAbsolutePath - Absolute path to the folder where the libcoreclr.so and CLR managed assemblies are stored
35 // managedAssemblyPath - Path to the managed assembly to execute
36 // managedAssemblyArgc - Number of arguments passed to the executed assembly
37 // managedAssemblyArgv - Array of arguments passed to the executed assembly
40 // ExitCode of the assembly
42 int ExecuteManagedAssembly(
43 const char* currentExeAbsolutePath
,
44 const char* clrFilesAbsolutePath
,
45 const char* managedAssemblyAbsolutePath
,
46 int managedAssemblyArgc
,
47 const char** managedAssemblyArgv
);
50 #if defined(__APPLE__)
51 #include <mach-o/dyld.h>
52 static const char * const coreClrDll
= "libcoreclr.dylib";
54 static const char * const coreClrDll
= "libcoreclr.so";