mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-14 22:20:52 +00:00

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74611 91177308-0d34-0410-b5e6-96231b3b80d8
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#include "AutoGenerated.inc"
|
|
#include "llvm/System/Path.h"
|
|
|
|
namespace llvmc {
|
|
extern char *ProgramName;
|
|
}
|
|
|
|
// Returns the platform specific directory separator via #ifdefs.
|
|
static std::string GetDirSeparator(void) {
|
|
return "/";
|
|
}
|
|
|
|
namespace hooks {
|
|
std::string GetBinDir (void) {
|
|
// Construct a Path object from the program name.
|
|
llvm::sys::Path ProgramFullName(llvmc::ProgramName,
|
|
strlen(llvmc::ProgramName));
|
|
|
|
// Get the dir name for the program. It's last component should be 'bin'.
|
|
std::string BinDir = ProgramFullName.getDirname();
|
|
|
|
return BinDir + GetDirSeparator();
|
|
}
|
|
|
|
std::string GetInstallDir (void) {
|
|
llvm::sys::Path BinDirPath = llvm::sys::Path(GetBinDir());
|
|
|
|
// Go one more level up to get the install dir.
|
|
std::string InstallDir = BinDirPath.getDirname();
|
|
|
|
return InstallDir + GetDirSeparator();
|
|
}
|
|
|
|
std::string GetStdHeadersDir (void) {
|
|
return GetInstallDir() + "include";
|
|
}
|
|
|
|
std::string GetStdAsmHeadersDir (void) {
|
|
return GetInstallDir() + "inc";
|
|
}
|
|
std::string GetStdLinkerScriptsDir (void) {
|
|
return GetInstallDir() + "lkr";
|
|
}
|
|
|
|
std::string GetStdLibsDir (void) {
|
|
return GetInstallDir() + "lib";
|
|
}
|
|
}
|