Fixed objjc to output compiled source not the input source

This commit is contained in:
Martin Carlberg
2013-01-09 14:58:22 +01:00
parent 1dfc77a4ba
commit 89da16afec
@@ -44,17 +44,20 @@ function compileWithResolvedFlags(aFilePath, objjcFlags, gccFlags, asPlainJavasc
executable,
code;
if (!shouldObjjPreprocess && OS.popen("which gcc").stdout.read().length === 0)
fileContents = FILE.read(aFilePath, { charset:"UTF-8" });
else
if (!shouldObjjPreprocess)
{
// GCC preprocess the file.
var gcc = OS.popen("gcc -E -x c -P " + (gccFlags ? gccFlags.join(" ") : "") + " " + OS.enquote(aFilePath), { charset:"UTF-8" }),
chunk = "";
if (OS.popen("which gcc").stdout.read().length === 0)
fileContents = FILE.read(aFilePath, { charset:"UTF-8" });
else
{
// GCC preprocess the file.
var gcc = OS.popen("gcc -E -x c -P " + (gccFlags ? gccFlags.join(" ") : "") + " " + OS.enquote(aFilePath), { charset:"UTF-8" }),
chunk = "";
while (chunk = gcc.stdout.read())
fileContents += chunk;
while (chunk = gcc.stdout.read())
fileContents += chunk;
}
return fileContents;
}