mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-20 14:53:14 +01:00
In config file: replace %%ldcbinarypath%% with the path to the ldc executable.
This commit is contained in:
@@ -88,8 +88,17 @@ bool ConfigFile::read(const char* argv0, void* mainAddr, const char* filename)
|
||||
int len = arr.getLength();
|
||||
for (int i=0; i<len; i++)
|
||||
{
|
||||
const char* v = arr[i];
|
||||
switches.push_back(v);
|
||||
std::string v = arr[i];
|
||||
|
||||
// replace binpathkey with binpath
|
||||
std::string binpathkey = "%%ldcbinarypath%%";
|
||||
sys::Path binpathgetter = sys::Path::GetMainExecutable(argv0, mainAddr);
|
||||
binpathgetter.eraseComponent();
|
||||
std::string binpath = binpathgetter.toString();
|
||||
size_t p;
|
||||
while (std::string::npos != (p = v.find(binpathkey)))
|
||||
v.replace(p, binpathkey.size(), binpath);
|
||||
switches.push_back(strdup(v.c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ default:
|
||||
switches = [
|
||||
"-I@RUNTIME_DIR@",
|
||||
"-I@RUNTIME_DIR@/lib/common",
|
||||
"-L-L@PROJECT_BINARY_DIR@/../lib",
|
||||
"-L-L%%ldcbinarydir%%/../lib",
|
||||
"-d-version=Tango",
|
||||
"-defaultlib=@RUNTIME_AIO@",
|
||||
"-debuglib=@RUNTIME_AIO@"
|
||||
|
||||
Reference in New Issue
Block a user