In config file: replace %%ldcbinarypath%% with the path to the ldc executable.

This commit is contained in:
Christian Kamm
2009-05-10 17:58:09 +02:00
parent 4f59c0cb7b
commit ba95eab71f
2 changed files with 12 additions and 3 deletions

View File

@@ -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()));
}
}

View File

@@ -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@"