mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-15 19:23:50 +00:00
Check for gcc.
Reviewed by me.
This commit is contained in:
1 parent
d4edb28837
commit
44cbcc60fa
1 file changed
+13
-7
@@ -55,15 +55,21 @@ function compileWithResolvedFlags(aFilePath, objjcFlags, gccFlags)
|
||||
{
|
||||
var shouldObjjPreprocess = objjcFlags & OBJJ_PREPROCESSOR_PREPROCESS,
|
||||
shouldCheckSyntax = objjcFlags & OBJJ_PREPROCESSOR_SYNTAX,
|
||||
shouldCompress = objjcFlags & OBJJ_PREPROCESSOR_COMPRESS;
|
||||
shouldCompress = objjcFlags & OBJJ_PREPROCESSOR_COMPRESS,
|
||||
fileContents = "";
|
||||
|
||||
// GCC preprocess the file.
|
||||
var gcc = OS.popen("gcc -E -x c -P " + (gccFlags ? gccFlags.join(" ") : "") + " " + aFilePath),
|
||||
fileContents = "",
|
||||
chunk = "";
|
||||
if (OS.popen("which gcc").stdout.read().length === 0)
|
||||
fileContents = FILE.read(aFilePath, { charset:"UTF-8" });
|
||||
|
||||
while (chunk = gcc.stdout.read())
|
||||
fileContents += chunk;
|
||||
else
|
||||
{
|
||||
// GCC preprocess the file.
|
||||
var gcc = OS.popen("gcc -E -x c -P " + (gccFlags ? gccFlags.join(" ") : "") + " " + aFilePath),
|
||||
chunk = "";
|
||||
|
||||
while (chunk = gcc.stdout.read())
|
||||
fileContents += chunk;
|
||||
}
|
||||
|
||||
if (!shouldObjjPreprocess)
|
||||
return fileContents;
|
||||
|
||||
Reference in new issue
Block a user