delete dir;
}
- property char * dir
+ property const char * dir
{
get
{
}
}
- void Evaluate(char * expression, Project project, CompilerConfig compiler, ProjectConfig config)
+ void Evaluate(const char * expression, Project project, CompilerConfig compiler, ProjectConfig config, int bitDepth)
{
int len;
- char * expr = expression;
+ const char * expr = expression;
if(!expr || !expr[0])
{
- char buffer[MAX_LOCATION];
if(ideSettings)
{
if(type == targetDir)
if((len = strlen(expr)))
{
int c, d;
- char * configName = config && config.name && config.name[0] ? config.name : "Common";
- char * projectName = project.name ? project.name : "";
- char * moduleName = project.moduleName ? project.moduleName : "";
- char * compilerName = (compiler && compiler.name) ? compiler.name : defaultCompilerName;
- char * targetPlatformName = compiler && compiler.targetPlatform ? compiler.targetPlatform : "";
+ const char * configName = config && config.name && config.name[0] ? config.name : "Common";
+ const char * moduleName = project && project.moduleName ? project.moduleName : "";
+ const char * compilerName = (compiler && compiler.name) ? compiler.name : defaultCompilerName;
+ const char * targetPlatformName = compiler && compiler.targetPlatform ? compiler.targetPlatform : "";
char buffer[MAX_LOCATION];
for(c = 0, d = 0; c < len; c++)
{
if(expr[c] == '$' && c < len - 1 && expr[c + 1] == '(')
{
int i;
+ bool matched = false;
for(i = c + 2; i < len; i++)
{
if(expr[i] == ')')
CamelCase(&buffer[d]);
d += strlen(configName);
c = i;
+ matched = true;
}
else if(!strnicmp(&expr[c + 2], "Module", n) || !strnicmp(&expr[c + 2], "Project", n))
{
//CamelCase(&buffer[d]);
d += strlen(moduleName);
c = i;
+ matched = true;
}
else if(!strnicmp(&expr[c + 2], "Platform", n))
{
CamelCase(&buffer[d]);
d += strlen(targetPlatformName);
c = i;
+ matched = true;
}
else if(!strnicmp(&expr[c + 2], "Compiler", n))
{
CamelCase(&buffer[d]);
d += strlen(compilerName);
c = i;
+ matched = true;
}
else if(!strnicmp(&expr[c + 2], "Debug_Suffix", n))
{
// We don't support .debug from the IDE yet...
c = i;
+ matched = true;
}
else if(!strnicmp(&expr[c + 2], "Compiler_Suffix", n))
{
- if(compilerName[0] && strcmpi(compilerName, "default"))
+ if(bitDepth || (compilerName[0] && strcmpi(compilerName, "default")))
{
- buffer[d] = '.';
- buffer[d+1] = '\0';
- strcat(buffer, compilerName);
- CamelCase(&buffer[d]);
- d += strlen(compilerName)+1;
- c = i;
+ if(compilerName[0] && strcmpi(compilerName, "default"))
+ {
+ buffer[d++] = '.';
+ buffer[d] = '\0';
+ strcat(buffer, compilerName);
+ CamelCase(&buffer[d]);
+ d += strlen(compilerName);
+ }
+ if(bitDepth == 32)
+ {
+ strcat(buffer, ".x32");
+ d += 4;
+ }
+ else if(bitDepth == 64)
+ {
+ strcat(buffer, ".x64");
+ d += 4;
+ }
}
- else
- c = i;
+ c = i;
+ matched = true;
}
- else
+ else if(compiler && compiler.environmentVars && compiler.environmentVars.count)
{
- buffer[d++] = expr[c];
+ for(ev : compiler.environmentVars;
+ ev.name && ev.string && ev.name[0] && ev.string[0] && !strnicmp(&expr[c + 2], ev.name, n) && strlen(ev.name) == n)
+ {
+ buffer[d] = '\0';
+ ChangeCh(ev.string, '\\', '/');
+ strcat(buffer, ev.string);
+ ChangeCh(ev.string, '/', '\\');
+ d += strlen(ev.string);
+ c = i;
+ matched = true;
+ break;
+ }
}
+ if(!matched)
+ buffer[d++] = expr[c];
}
else
{
isset { return objectsDirectory != null/*&& objectsDirectory[0]*/; }
}
Array<String> libraries;
+ Array<String> compilerOptions;
Array<String> linkerOptions;
property Array<String> libraryDirs
{
get { return postbuildCommands; }
isset { return postbuildCommands && postbuildCommands.count; }
}
+ property Array<String> installCommands
+ {
+ set
+ {
+ if(installCommands)
+ installCommands.Free();
+ if(value && value.count)
+ {
+ if(!installCommands)
+ installCommands = { };
+ for(s : value)
+ installCommands.Add(CopyValidateMakefilePath(s));
+ value.Free();
+ delete value;
+ }
+ else
+ delete installCommands;
+ }
+ get { return installCommands; }
+ isset { return installCommands && installCommands.count; }
+ }
ProjectOptions Copy()
{
console = console,
compress = compress,
excludeFromBuild = excludeFromBuild,
- buildBitDepth = buildBitDepth,
fastMath = fastMath,
preprocessorDefinitions = CopyArrayString(preprocessorDefinitions),
includeDirs = CopyArrayString(includeDirs),
libraries = CopyArrayString(libraries),
+ compilerOptions = CopyArrayString(compilerOptions),
linkerOptions = CopyArrayString(linkerOptions),
libraryDirs = CopyArrayString(libraryDirs),
prebuildCommands = CopyArrayString(prebuildCommands),
- postbuildCommands = CopyArrayString(postbuildCommands)
+ postbuildCommands = CopyArrayString(postbuildCommands),
+ installCommands = CopyArrayString(installCommands)
};
}
//...
//PrintLn("dddddddd:", dddddddd);
- PrintLn("buildBitDepth:", buildBitDepth);
PrintLn("fastMath:", fastMath);
PrintLn("preprocessorDefinitions:", preprocessorDefinitions);
+ PrintLn("compilerOptions:", compilerOptions);
+ PrintLn("linkerOptions:", linkerOptions);
PrintLn("includeDirs:", includeDirs);
//...
delete targetDirectory;
delete objectsDirectory;
if(libraries) { libraries.Free(); delete libraries; }
+ if(compilerOptions) { compilerOptions.Free(); delete compilerOptions; }
if(linkerOptions) { linkerOptions.Free(); delete linkerOptions; }
if(libraryDirs) { libraryDirs.Free(); delete libraryDirs; }
if(prebuildCommands) { prebuildCommands.Free(); delete prebuildCommands; }
if(postbuildCommands) { postbuildCommands.Free(); delete postbuildCommands; }
+ if(installCommands) { installCommands.Free(); delete installCommands; }
}
private:
Array<String> includeDirs;
Array<String> libraryDirs;
Array<String> prebuildCommands;
Array<String> postbuildCommands;
+ Array<String> installCommands;
property bool isEmpty
{
!targetDirectory &&
!objectsDirectory &&
!libraries &&
+ !compilerOptions &&
!linkerOptions &&
(!libraryDirs || !libraryDirs.count) &&
console == unset &&
compress == unset &&
excludeFromBuild == unset &&
- buildBitDepth == all &&
fastMath == unset &&
(!prebuildCommands || !prebuildCommands.count) &&
- (!postbuildCommands || !postbuildCommands.count) )
+ (!postbuildCommands || !postbuildCommands.count) &&
+ (!installCommands || !installCommands.count))
return true;
- return false;
+ return false;
}
}
}