Author: faridz
Date: Thu Sep 6 11:58:06 2007
New Revision: 573335
URL: http://svn.apache.org/viewvc?rev=573335&view=rev
Log:
2007-09-06 Farid Zaripov <[EMAIL PROTECTED]>
* msvc-7.0.config: Added AS config variable.
* msvc-8.0-x64.config: Ditto.
* filterdef.js: Added definition of the CustomFileDef class
(AddFilterFile): Invoke custom init function if current file
is present in platform dependent file definitions array.
* projectdef.js (InitAsmTool): New function to init custom build rule
for .asm files.
* utilities.js: Read AS configuration variable from the .config file.
Modified:
incubator/stdcxx/trunk/etc/config/windows/filterdef.js
incubator/stdcxx/trunk/etc/config/windows/msvc-7.0.config
incubator/stdcxx/trunk/etc/config/windows/msvc-8.0-x64.config
incubator/stdcxx/trunk/etc/config/windows/projectdef.js
incubator/stdcxx/trunk/etc/config/windows/utilities.js
Modified: incubator/stdcxx/trunk/etc/config/windows/filterdef.js
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/filterdef.js?rev=573335&r1=573334&r2=573335&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/filterdef.js (original)
+++ incubator/stdcxx/trunk/etc/config/windows/filterdef.js Thu Sep 6 11:58:06
2007
@@ -25,7 +25,7 @@
var sourceFilterName = "Source Files";
var sourceFilterUuid = "{4FC737F1-C7A5-4376-A066-2A32D752A2FF}";
-var sourceFilterExts = ".cpp;.cxx;.s";
+var sourceFilterExts = ".cpp;.cxx;.s;.asm";
var headerFilterName = "Header Files";
var headerFilterUuid = "{93995380-89BD-4b04-88EB-625FBE52EBFB}";
@@ -56,6 +56,21 @@
return str;
}
+//------------------------------------------------
+// CustomFileDef class
+//------------------------------------------------
+
+// CustomFileDef .ctor
+function CustomFileDef(filepath, platform, initfun)
+{
+ this.filepath = filepath;
+ this.platform = platform;
+ this.initfun = initfun;
+}
+
+// global array with platform dependent files definitions
+var customFileDefs = new Array();
+
// common macros
var cmnMacros = new Array();
@@ -126,7 +141,29 @@
var VCFile = filter.AddFile(filename);
if (null != filetype && typeof(VCFile.FileType) != "undefined")
VCFile.FileType = filetype;
-
+
+ var customFileDef = null;
+
+ if (!exclude)
+ {
+ // find the platform dependent file definition
+ for (var i = 0; i < customFileDefs.length; ++i)
+ {
+ var custFileDef = customFileDefs[i];
+ var pos = VCFile.FullPath.length - custFileDef.filepath.length;
+ if (0 <= pos && pos ==
VCFile.FullPath.indexOf(custFileDef.filepath))
+ {
+ customFileDef = custFileDef;
+ break;
+ }
+ }
+
+ // exclude this file from build if current platform
+ // is not custom file target platform
+ if (null != customFileDef && customFileDef.platform != PLATFORM)
+ exclude = true;
+ }
+
if (exclude)
{
var cfgs = VCFile.FileConfigurations;
@@ -143,6 +180,12 @@
cfg.ExcludedFromBuild = exclude;
}
+ }
+ else if (null != customFileDef &&
+ "undefined" != typeof(customFileDef.initfun))
+ {
+ // init
+ customFileDef.initfun(VCFile);
}
}
Modified: incubator/stdcxx/trunk/etc/config/windows/msvc-7.0.config
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/msvc-7.0.config?rev=573335&r1=573334&r2=573335&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/msvc-7.0.config (original)
+++ incubator/stdcxx/trunk/etc/config/windows/msvc-7.0.config Thu Sep 6
11:58:06 2007
@@ -38,6 +38,7 @@
CXX=cl
LD=cl
AR=lib
+AS=ml
// Use singlethreaded or mutlithreaded CRT in 11s, 11d solution configurations
// 0 for MS VisualStudio .NET and MS VisualStudio .NET 2003
Modified: incubator/stdcxx/trunk/etc/config/windows/msvc-8.0-x64.config
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/msvc-8.0-x64.config?rev=573335&r1=573334&r2=573335&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/msvc-8.0-x64.config (original)
+++ incubator/stdcxx/trunk/etc/config/windows/msvc-8.0-x64.config Thu Sep 6
11:58:06 2007
@@ -1,2 +1,3 @@
#include msvc-8.0
PLATFORM=x64
+AS=ml64
Modified: incubator/stdcxx/trunk/etc/config/windows/projectdef.js
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/projectdef.js?rev=573335&r1=573334&r2=573335&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/projectdef.js (original)
+++ incubator/stdcxx/trunk/etc/config/windows/projectdef.js Thu Sep 6 11:58:06
2007
@@ -945,3 +945,25 @@
return projectDef;
}
+
+// init custom build rule for .asm files
+function InitAsmTool(VCFile)
+{
+ var cfgs = VCFile.FileConfigurations;
+ for (var i = 1; i <= cfgs.Count; ++i)
+ {
+ var cfg = cfgs.Item(i);
+ if ((typeof(cfg.Tool.ToolKind) != "undefined" &&
+ cfg.Tool.ToolKind != "VCCustomBuildTool") ||
+ cfg.Tool.ToolName != "Custom Build Tool")
+ {
+ cfg.Tool =
cfg.ProjectConfiguration.FileTools.Item("VCCustomBuildTool");
+ }
+
+ var tool = cfg.Tool;
+ tool.Description = "Compiling .asm file...";
+ tool.Outputs = "$(IntDir)\\$(InputName).obj";
+ tool.CommandLine = AS + " /c /nologo /Fo" + tool.Outputs +
+ " /W3 /Zi /Ta" + VCFile.RelativePath;
+ }
+}
Modified: incubator/stdcxx/trunk/etc/config/windows/utilities.js
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/utilities.js?rev=573335&r1=573334&r2=573335&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/utilities.js (original)
+++ incubator/stdcxx/trunk/etc/config/windows/utilities.js Thu Sep 6 11:58:06
2007
@@ -32,6 +32,7 @@
var CXX = "cl";
var LD = "cl";
var AR = "lib";
+var AS = "ml";
var SLNVER="8.00";
var SLNCOMMENT="";
var UNICODELOG = false;
@@ -112,6 +113,9 @@
case "AR":
AR = arr[2];
break;
+ case "AS":
+ AS = arr[2];
+ break;
case "SLNVER":
SLNVER = arr[2];
break;
@@ -179,6 +183,7 @@
stream.WriteLine(" CXX=" + CXX);
stream.WriteLine(" LD=" + LD);
stream.WriteLine(" AR=" + AR);
+ stream.WriteLine(" AS=" + AS);
stream.WriteLine(" SLNVER=" + SLNVER);
stream.WriteLine(" SLNCOMMENT=" + SLNCOMMENT);
stream.WriteLine(" UNICODELOG=" + UNICODELOG);