mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Created a Unix version of coreconsole which, like the Windows version, is similar to corerun but runs the managed binary with the same name as the executable (but with the DLL extension). Moved code that is common between corerun and coreconsole to coreruncommon. Remove the workaround for the XCode 6.3 SDK issue wherein some of the system headers that we reference try to include a __debug header which does not exist. The 6.3.1 update fixed that issue so the workaround is no longer required. Fix #747
47 lines
1.9 KiB
C++
47 lines
1.9 KiB
C++
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
#include <string>
|
|
|
|
// Get absolute path from the specified path.
|
|
// Return true in case of a success, false otherwise.
|
|
bool GetAbsolutePath(const char* path, std::string& absolutePath);
|
|
|
|
// Get directory of the specified path.
|
|
// Return true in case of a success, false otherwise.
|
|
bool GetDirectory(const char* absolutePath, std::string& directory);
|
|
|
|
//
|
|
// Get the absolute path to use to locate libcoreclr.so and the CLR assemblies are stored. If clrFilesPath is provided,
|
|
// this function will return the absolute path to it. Otherwise, the directory of the current executable is used.
|
|
//
|
|
// Return true in case of a success, false otherwise.
|
|
//
|
|
bool GetClrFilesAbsolutePath(const char* currentExePath, const char* clrFilesPath, std::string& clrFilesAbsolutePath);
|
|
|
|
// Add all *.dll, *.ni.dll, *.exe, and *.ni.exe files from the specified directory to the tpaList string.
|
|
void AddFilesFromDirectoryToTpaList(const char* directory, std::string& tpaList);
|
|
|
|
//
|
|
// Execute the specified managed assembly.
|
|
//
|
|
// Parameters:
|
|
// currentExePath - Path to the current executable
|
|
// clrFilesAbsolutePath - Absolute path to the folder where the libcoreclr.so and CLR managed assemblies are stored
|
|
// managedAssemblyPath - Path to the managed assembly to execute
|
|
// managedAssemblyArgc - Number of arguments passed to the executed assembly
|
|
// managedAssemblyArgv - Array of arguments passed to the executed assembly
|
|
//
|
|
// Returns:
|
|
// ExitCode of the assembly
|
|
//
|
|
int ExecuteManagedAssembly(
|
|
const char* currentExeAbsolutePath,
|
|
const char* clrFilesAbsolutePath,
|
|
const char* managedAssemblyAbsolutePath,
|
|
int managedAssemblyArgc,
|
|
const char** managedAssemblyArgv);
|
|
|