mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: Introduce ’jake install-inline’ task to generate the cappuccino framework with objj_msgSend function inlined. Also introduced options in ’index-debug.html’ templates to allow inline of objj_msgSend function when compiling in browser.
This commit is contained in:
+3
-2
@@ -33,8 +33,9 @@ appKitTask = framework ("AppKit", function(appKitTask)
|
|||||||
return "--include \"" + aFilename + "\"";
|
return "--include \"" + aFilename + "\"";
|
||||||
}).join(" ");
|
}).join(" ");
|
||||||
|
|
||||||
if ($CONFIGURATION === "Release")
|
if ($CONFIGURATION === "Release") {
|
||||||
appKitTask.setCompilerFlags("-O " + INCLUDES);
|
appKitTask.setCompilerFlags(($INLINE_MSG_SEND ? "-O2 " : "-O ") + INCLUDES);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
appKitTask.setCompilerFlags("-DDEBUG -g " + INCLUDES);
|
appKitTask.setCompilerFlags("-DDEBUG -g " + INCLUDES);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ blendKitTask = framework ("BlendKit", function(blendKitTask)
|
|||||||
blendKitTask.setFlattensSources(true); // FIXME: how do we non flatten?
|
blendKitTask.setFlattensSources(true); // FIXME: how do we non flatten?
|
||||||
|
|
||||||
if ($CONFIGURATION === "Release")
|
if ($CONFIGURATION === "Release")
|
||||||
blendKitTask.setCompilerFlags("-O");
|
blendKitTask.setCompilerFlags($INLINE_MSG_SEND ? "-O2" : "-O");
|
||||||
else
|
else
|
||||||
blendKitTask.setCompilerFlags("-DDEBUG -g");
|
blendKitTask.setCompilerFlags("-DDEBUG -g");
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ foundationTask = framework ("Foundation", function(foundationTask)
|
|||||||
INCLUDES = "--include \"../AppKit/Platform/Platform.h\" " + INCLUDES;
|
INCLUDES = "--include \"../AppKit/Platform/Platform.h\" " + INCLUDES;
|
||||||
|
|
||||||
if ($CONFIGURATION === "Release")
|
if ($CONFIGURATION === "Release")
|
||||||
foundationTask.setCompilerFlags("-O " + INCLUDES);
|
foundationTask.setCompilerFlags(($INLINE_MSG_SEND ? "-O2 " : "-O ") + INCLUDES);
|
||||||
else
|
else
|
||||||
foundationTask.setCompilerFlags("-DDEBUG -g " + INCLUDES);
|
foundationTask.setCompilerFlags("-DDEBUG -g " + INCLUDES);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ var subprojects = ["Objective-J", "CommonJS", "Foundation", "AppKit", "Tools"];
|
|||||||
$BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS = FILE.join($BUILD_CJS_OBJECTIVE_J, "Frameworks", "Debug");
|
$BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS = FILE.join($BUILD_CJS_OBJECTIVE_J, "Frameworks", "Debug");
|
||||||
|
|
||||||
|
|
||||||
filedir ($BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, ["debug", "release"], function()
|
filedir ($BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, [], function()
|
||||||
{
|
{
|
||||||
FILE.mkdirs($BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS);
|
FILE.mkdirs($BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS);
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ filedir ($BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, ["debug", "release"], function
|
|||||||
|
|
||||||
$BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS = FILE.join($BUILD_CJS_CAPPUCCINO, "Frameworks", "Debug");
|
$BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS = FILE.join($BUILD_CJS_CAPPUCCINO, "Frameworks", "Debug");
|
||||||
|
|
||||||
filedir ($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, ["debug", "release"], function()
|
filedir ($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, [], function()
|
||||||
{
|
{
|
||||||
FILE.mkdirs($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS);
|
FILE.mkdirs($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS);
|
||||||
|
|
||||||
@@ -39,7 +39,9 @@ filedir ($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, ["debug", "release"], function(
|
|||||||
cp_r(FILE.join($BUILD_DIR, "Debug", "BlendKit"), FILE.join($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "BlendKit"));
|
cp_r(FILE.join($BUILD_DIR, "Debug", "BlendKit"), FILE.join($BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "BlendKit"));
|
||||||
});
|
});
|
||||||
|
|
||||||
task ("CommonJS", [$BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, $BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "debug", "release"]);
|
task ("CommonJS", ["debug", "release", $BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, $BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "debug", "release"]);
|
||||||
|
|
||||||
|
task ("CommonJS-inline", ["debug", "release-inline", $BUILD_CJS_OBJECTIVE_J_DEBUG_FRAMEWORKS, $BUILD_CJS_CAPPUCCINO_DEBUG_FRAMEWORKS, "debug", "release-inline"]);
|
||||||
|
|
||||||
task ("install", ["CommonJS"], function()
|
task ("install", ["CommonJS"], function()
|
||||||
{
|
{
|
||||||
@@ -47,6 +49,12 @@ task ("install", ["CommonJS"], function()
|
|||||||
installCopy($BUILD_CJS_CAPPUCCINO, false);
|
installCopy($BUILD_CJS_CAPPUCCINO, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
task ("install-inline", ["CommonJS-inline"], function()
|
||||||
|
{
|
||||||
|
installCopy($BUILD_CJS_OBJECTIVE_J, false);
|
||||||
|
installCopy($BUILD_CJS_CAPPUCCINO, false);
|
||||||
|
});
|
||||||
|
|
||||||
task ("sudo-install", ["CommonJS"], function()
|
task ("sudo-install", ["CommonJS"], function()
|
||||||
{
|
{
|
||||||
installCopy($BUILD_CJS_OBJECTIVE_J, true);
|
installCopy($BUILD_CJS_OBJECTIVE_J, true);
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ function FileRequest(/*CFURL*/ aURL, onsuccess, onfailure, onprogress)
|
|||||||
{
|
{
|
||||||
var aFilePath = aURL.toString().substring(5),
|
var aFilePath = aURL.toString().substring(5),
|
||||||
OS = require("os"),
|
OS = require("os"),
|
||||||
gccFlags = require("objective-j").currentCompilerFlags(),
|
gccFlags = require("objective-j").currentGccCompilerFlags(),
|
||||||
chunk,
|
chunk,
|
||||||
fileContents = "";
|
fileContents = "";
|
||||||
|
|
||||||
|
|||||||
@@ -192,8 +192,12 @@ function resolveFlags(args)
|
|||||||
else if (argument.indexOf("-g") === 0)
|
else if (argument.indexOf("-g") === 0)
|
||||||
objjcFlags |= ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols;
|
objjcFlags |= ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols;
|
||||||
|
|
||||||
else if (argument.indexOf("-O") === 0)
|
else if (argument.indexOf("-O") === 0) {
|
||||||
objjcFlags |= ObjectiveJ.ObjJAcornCompiler.Flags.Compress;
|
objjcFlags |= ObjectiveJ.ObjJAcornCompiler.Flags.Compress;
|
||||||
|
// FIXME: currently we are sending in '-O2' when we want InlineMsgSend. Here we only check if we it is '-O...'
|
||||||
|
if (argument.length > 2)
|
||||||
|
objjcFlags |= ObjectiveJ.ObjJAcornCompiler.Flags.InlineMsgSend;
|
||||||
|
}
|
||||||
|
|
||||||
else if (argument.indexOf("-G") === 0)
|
else if (argument.indexOf("-G") === 0)
|
||||||
objjcFlags |= ObjectiveJ.ObjJAcornCompiler.Flags.Generate;
|
objjcFlags |= ObjectiveJ.ObjJAcornCompiler.Flags.Generate;
|
||||||
|
|||||||
@@ -907,7 +907,7 @@ BundleTask.prototype.defineSourceTasks = function()
|
|||||||
basePath = absolutePath.substring(0, absolutePath.length - theTranslatedFilename.length);
|
basePath = absolutePath.substring(0, absolutePath.length - theTranslatedFilename.length);
|
||||||
|
|
||||||
// Here we set the current compiler flags so the load system will know what compiler flags to use
|
// Here we set the current compiler flags so the load system will know what compiler flags to use
|
||||||
ObjectiveJ.setCurrentCompilerFlags(environmentCompilerFlags);
|
ObjectiveJ.setCurrentGccCompilerFlags(environmentCompilerFlags);
|
||||||
// Here we tell the CFBundle to load frameworks for the current build enviroment and not the enviroment that is running
|
// Here we tell the CFBundle to load frameworks for the current build enviroment and not the enviroment that is running
|
||||||
CFBundle.environments = function() {return [anEnvironment.name(), "ObjJ"]};
|
CFBundle.environments = function() {return [anEnvironment.name(), "ObjJ"]};
|
||||||
ObjectiveJ.make_narwhal_factory(absolutePath, basePath, translateFilenameToPath)(require, e, module, system, print);
|
ObjectiveJ.make_narwhal_factory(absolutePath, basePath, translateFilenameToPath)(require, e, module, system, print);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ function FileExecutable(/*CFURL|String*/ aURL, /*Dictionary*/ aFilenameTranslate
|
|||||||
if (fileContents.match(/^@STATIC;/))
|
if (fileContents.match(/^@STATIC;/))
|
||||||
executable = decompile(fileContents, aURL);
|
executable = decompile(fileContents, aURL);
|
||||||
else if ((extension === "j" || !extension) && !fileContents.match(/^{/))
|
else if ((extension === "j" || !extension) && !fileContents.match(/^{/))
|
||||||
executable = exports.ObjJAcornCompiler.compileFileDependencies(fileContents, aURL, ObjJAcornCompiler.Flags.IncludeDebugSymbols);
|
executable = exports.ObjJAcornCompiler.compileFileDependencies(fileContents, aURL, exports.currentCompilerFlags());
|
||||||
else
|
else
|
||||||
executable = new Executable(fileContents, [], aURL);
|
executable = new Executable(fileContents, [], aURL);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ var FILENAMES = [
|
|||||||
correct = FILE.read(FILE.join(FILE.dirname(module.path), filename + ".js"));
|
correct = FILE.read(FILE.join(FILE.dirname(module.path), filename + ".js"));
|
||||||
|
|
||||||
[self assertNoThrow:function() {
|
[self assertNoThrow:function() {
|
||||||
preprocessed = ObjectiveJ.ObjJAcornCompiler.compileToExecutable(unpreprocessed).code();
|
preprocessed = ObjectiveJ.ObjJAcornCompiler.compileToExecutable(unpreprocessed, nil, ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols/* | ObjectiveJ.ObjJAcornCompiler.Flags.IncludeTypeSignatures*/).code();
|
||||||
preprocessed = compressor.compress(preprocessed, { charset : "UTF-8", useServer : true });
|
preprocessed = compressor.compress(preprocessed, { charset : "UTF-8", useServer : true });
|
||||||
correct = compressor.compress(correct, { charset : "UTF-8", useServer : true });
|
correct = compressor.compress(correct, { charset : "UTF-8", useServer : true });
|
||||||
}];
|
}];
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ app (projectName, function(task)
|
|||||||
if (configuration === "Debug")
|
if (configuration === "Debug")
|
||||||
task.setCompilerFlags("-DDEBUG -g");
|
task.setCompilerFlags("-DDEBUG -g");
|
||||||
else
|
else
|
||||||
task.setCompilerFlags("-O");
|
task.setCompilerFlags("-O2");
|
||||||
});
|
});
|
||||||
|
|
||||||
task ("default", [projectName], function()
|
task ("default", [projectName], function()
|
||||||
|
|||||||
@@ -61,6 +61,11 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
objj_msgSend_reset();
|
objj_msgSend_reset();
|
||||||
|
|
||||||
|
// COMPILER OPTIONS:
|
||||||
|
|
||||||
|
// Uncomment to generate debug symbols, type signatures and/or inline objj_msgSend functions
|
||||||
|
// ObjectiveJ.setCurrentCompilerFlags(ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols | ObjectiveJ.ObjJAcornCompiler.Flags.IncludeTypeSignatures | ObjectiveJ.ObjJAcornCompiler.Flags.InlineMsgSend);
|
||||||
|
|
||||||
// DEBUG OPTIONS:
|
// DEBUG OPTIONS:
|
||||||
|
|
||||||
// Uncomment to enable printing of backtraces on exceptions:
|
// Uncomment to enable printing of backtraces on exceptions:
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ var frameworkTask = framework (productName, function(frameworkTask)
|
|||||||
if (configuration === "Debug")
|
if (configuration === "Debug")
|
||||||
frameworkTask.setCompilerFlags("-DDEBUG -g");
|
frameworkTask.setCompilerFlags("-DDEBUG -g");
|
||||||
else
|
else
|
||||||
frameworkTask.setCompilerFlags("-O");
|
frameworkTask.setCompilerFlags("-O2");
|
||||||
});
|
});
|
||||||
|
|
||||||
task ("debug", function()
|
task ("debug", function()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ app (projectName, function(task)
|
|||||||
if (configuration === "Debug")
|
if (configuration === "Debug")
|
||||||
task.setCompilerFlags("-DDEBUG -g");
|
task.setCompilerFlags("-DDEBUG -g");
|
||||||
else
|
else
|
||||||
task.setCompilerFlags("-O");
|
task.setCompilerFlags("-O2");
|
||||||
});
|
});
|
||||||
|
|
||||||
task ("default", [projectName], function()
|
task ("default", [projectName], function()
|
||||||
|
|||||||
@@ -61,6 +61,11 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
objj_msgSend_reset();
|
objj_msgSend_reset();
|
||||||
|
|
||||||
|
// COMPILER OPTIONS:
|
||||||
|
|
||||||
|
// Uncomment to generate debug symbols, type signatures and/or inline objj_msgSend functions
|
||||||
|
// ObjectiveJ.setCurrentCompilerFlags(ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols | ObjectiveJ.ObjJAcornCompiler.Flags.IncludeTypeSignatures | ObjectiveJ.ObjJAcornCompiler.Flags.InlineMsgSend);
|
||||||
|
|
||||||
// DEBUG OPTIONS:
|
// DEBUG OPTIONS:
|
||||||
|
|
||||||
// Uncomment to enable printing of backtraces on exceptions:
|
// Uncomment to enable printing of backtraces on exceptions:
|
||||||
|
|||||||
@@ -61,6 +61,11 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
objj_msgSend_reset();
|
objj_msgSend_reset();
|
||||||
|
|
||||||
|
// COMPILER OPTIONS:
|
||||||
|
|
||||||
|
// Uncomment to generate debug symbols, type signatures and/or inline objj_msgSend functions
|
||||||
|
// ObjectiveJ.setCurrentCompilerFlags(ObjectiveJ.ObjJAcornCompiler.Flags.IncludeDebugSymbols | ObjectiveJ.ObjJAcornCompiler.Flags.IncludeTypeSignatures | ObjectiveJ.ObjJAcornCompiler.Flags.InlineMsgSend);
|
||||||
|
|
||||||
// DEBUG OPTIONS:
|
// DEBUG OPTIONS:
|
||||||
|
|
||||||
// Uncomment to enable printing of backtraces on exceptions:
|
// Uncomment to enable printing of backtraces on exceptions:
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ global.filedir = JAKE.filedir;
|
|||||||
global.FileList = JAKE.FileList;
|
global.FileList = JAKE.FileList;
|
||||||
|
|
||||||
global.$CONFIGURATION = SYSTEM.env['CONFIG'];
|
global.$CONFIGURATION = SYSTEM.env['CONFIG'];
|
||||||
|
global.$INLINE_MSG_SEND = SYSTEM.env['INLINE_MSG_SEND'];
|
||||||
global.$BUILD_DIR = SYSTEM.env['BUILD_PATH'];
|
global.$BUILD_DIR = SYSTEM.env['BUILD_PATH'];
|
||||||
global.$BUILD_CONFIGURATION_DIR = FILE.join($BUILD_DIR, $CONFIGURATION);
|
global.$BUILD_CONFIGURATION_DIR = FILE.join($BUILD_DIR, $CONFIGURATION);
|
||||||
|
|
||||||
@@ -597,6 +598,13 @@ task ("release", function()
|
|||||||
spawnJake("build");
|
spawnJake("build");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
task ("release-inline", function()
|
||||||
|
{
|
||||||
|
SYSTEM.env["CONFIG"] = "Release";
|
||||||
|
SYSTEM.env['INLINE_MSG_SEND'] = true;
|
||||||
|
spawnJake("build");
|
||||||
|
});
|
||||||
|
|
||||||
task ("debug", function()
|
task ("debug", function()
|
||||||
{
|
{
|
||||||
SYSTEM.env["CONFIG"] = "Debug";
|
SYSTEM.env["CONFIG"] = "Debug";
|
||||||
|
|||||||
Reference in New Issue
Block a user