Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt7
-rw-r--r--src/actions/vstudio/vs200x_vcproj.tmpl4
-rw-r--r--src/host/scripts.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index f0b0906..ebe56f0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,11 @@
-----
+ 4.1 (in progress)
+-----
+
+- Support links and libdirs for Visual Studio static libraries
+
+
+-----
4.0
-----
diff --git a/src/actions/vstudio/vs200x_vcproj.tmpl b/src/actions/vstudio/vs200x_vcproj.tmpl
index daf99fc..5ed40e5 100644
--- a/src/actions/vstudio/vs200x_vcproj.tmpl
+++ b/src/actions/vstudio/vs200x_vcproj.tmpl
@@ -162,7 +162,11 @@
TargetMachine="1"
<% else %>
Name="VCLibrarianTool"
+ <% if #cfg.links > 0 then %>
+ AdditionalDependencies="<%= table.concat(premake.getlinks(cfg, "all", "fullpath"), " ") %>"
+ <% end %>
OutputFile="$(OutDir)\<%= cfg.buildtarget.name %>"
+ AdditionalLibraryDirectories="<%= table.concat(premake.esc(path.translate(cfg.libdirs)) , ";") %>"
<% end %>
/>
<% elseif (block == "VCManagedResourceCompilerTool") then %>
diff --git a/src/host/scripts.c b/src/host/scripts.c
index 4ac4be2..c3a1e74 100644
--- a/src/host/scripts.c
+++ b/src/host/scripts.c
@@ -32,7 +32,7 @@ const char* builtin_scripts[] = {
"_TEMPLATES.vs2005_solution=premake.loadtemplatestring('vs2005_solution',[[<% eol = \"\\r\\n\" %>\n<%= \"\\239\\187\\191\" %>\n<% local hascpp, hasdotnet %>\n<% if _ACTION == \"vs2005\" then %>\nMicrosoft Visual Studio Solution File, Format Version 9.00\n# Visual Studio 2005\n<% elseif _ACTION == \"vs2008\" then %>\nMicrosoft Visual Studio Solution File, Format Version 10.00\n# Visual Studio 2008\n<% end %>\n<% for prj in premake.eachproject(this) do %>\n <% if (prj.language == \"C\" or prj.language == \"C++\") then hascpp = true end %>\n <% if (prj.language == \"C#\") then hasdotnet = true end %>\nProject(\"{<%=_VS.tool(prj)%>}\") = \"<%=prj.name%>\", \"<%=path.translate(path.getrelative(this.location, _VS.projectfile(prj)),\"\\\\\")%>\", \"{<%=prj.uuid%>}\"\n <% local deps = premake.getdependencies(prj); if #deps > 0 then %>\n ProjectSection(ProjectDependencies) = postProject\n <% for _,dep in ipairs(deps) do %>\n {<%= dep.uuid %>} = {<%= dep.uuid %>}\n <% end %>\n EndProjectSection\n <% end %>\nEndProject\n<% end %>\nGlobal\n GlobalSection(SolutionConfigurationPlatforms) = preSolution\n <% for _, cfgname in ipairs(this.configurations) do %>\n <% if hasdotnet then %>\n <%= cfgname %>|Any CPU = <%= cfgname %>|Any CPU\n <% end; if hasdotnet and hascpp then %>\n <%= cfgname %>|Mixed Platforms = <%= cfgname %>|Mixed Platforms\n <% end; if hascpp then %>\n <%= cfgname %>|Win32 = <%= cfgname %>|Win32\n <% end %>\n <% end %>\n EndGlobalSection\n GlobalSection(ProjectConfigurationPlatforms) = postSolution\n <% for prj in premake.eachproject(this) do %>\n <% for _, cfgname in ipairs(this.configurations) do %>\n <% if hasdotnet then %>\n {<%= prj.uuid %>}.<%= cfgname %>|Any CPU.ActiveCfg = <%= cfgname %>|<%= _VS.arch(prj) %>\n <% if (prj.language ~= \"C\" and prj.language ~= \"C++\") then %>\n {<%= prj.uuid %>}.<%= cfgname %>|Any CPU.Build.0 = <%= cfgname %>|<%= _VS.arch(prj) %>\n <% end %>\n <% end; if (hasdotnet and hascpp) then %>\n {<%= prj.uuid %>}.<%= cfgname %>|Mixed Platforms.ActiveCfg = <%= cfgname %>|<%= _VS.arch(prj) %>\n {<%= prj.uuid %>}.<%= cfgname %>|Mixed Platforms.Build.0 = <%= cfgname %>|<%= _VS.arch(prj) %>\n <% end; if (hascpp) then %>\n {<%= prj.uuid %>}.<%= cfgname %>|Win32.ActiveCfg = <%= cfgname %>|<%= _VS.arch(prj) %>\n <% if (prj.language == \"C\" or prj.language == \"C++\") then %>\n {<%= prj.uuid %>}.<%= cfgname %>|Win32.Build.0 = <%= cfgname %>|<%= _VS.arch(prj) %>\n <% end %>\n <% end %>\n <% end %>\n <% end %>\n EndGlobalSection\n GlobalSection(SolutionProperties) = preSolution\n HideSolutionNode = FALSE\n EndGlobalSection\nEndGlobal\n]])",
"_TEMPLATES.vs2005_csproj=premake.loadtemplatestring('vs2005_csproj',[[<% \n eol = \"\\r\\n\" \n local csc = premake.csc\n\n -- translate the action to format and tool versions\n local vsversion, toolversion\n if _ACTION == \"vs2005\" then\n vsversion = \"8.0.50727\"\n toolversion = nil\n elseif _ACTION == \"vs2008\" then\n vsversion = \"9.0.50727\"\n toolversion = \"3.5\"\n end\n \n --\n -- Figure out what elements a particular source code file need in its item\n -- block, based on its build action and any related files in the project.\n -- \n \n function getelements(prj, action, fname)\n \n if action == \"Compile\" and fname:endswith(\".cs\") then\n if fname:endswith(\".Designer.cs\") then\n -- is there a matching *.cs file?\n local basename = fname:sub(1, -13)\n local testname = basename .. \".cs\"\n if premake.findfile(prj, testname) then\n return \"Dependency\", testname\n end\n -- is there a matching *.resx file?\n testname = basename .. \".resx\"\n if premake.findfile(prj, testname) then\n return \"AutoGen\", testname\n end\n else\n -- is there a *.Designer.cs file?\n local basename = fname:sub(1, -4)\n local testname = basename .. \".Designer.cs\"\n if premake.findfile(prj, testname) then\n return \"SubTypeForm\"\n end\n end\n end\n\n if action == \"EmbeddedResource\" and fname:endswith(\".resx\") then\n -- is there a matching *.cs file?\n local basename = fname:sub(1, -6)\n local testname = path.getname(basename .. \".cs\")\n if premake.findfile(prj, testname) then\n if premake.findfile(prj, basename .. \".Designer.cs\") then\n return \"DesignerType\", testname\n else\n return \"Dependency\", testname\n end\n else\n -- is there a matching *.Designer.cs?\n testname = path.getname(basename .. \".Designer.cs\")\n if premake.findfile(prj, testname) then\n return \"AutoGenerated\"\n end\n end\n end\n \n if action == \"Content\" then\n return \"CopyNewest\"\n end\n \n return \"None\"\n end\n\n -- end of preprocessing; template starts here -- \n%>\n<% if toolversion then %>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"<%= toolversion %>\">\n<% else %>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n<% end %>\n <PropertyGroup>\n <Configuration Condition=\" '$(Configuration)' == '' \"><%= premake.esc(this.solution.configurations[1]) %></Configuration>\n <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n <ProductVersion><%= vsversion %></ProductVersion>\n <SchemaVersion>2.0</SchemaVersion>\n <ProjectGuid>{<%= this.uuid %>}</ProjectGuid>\n <OutputType><%= csc.getkind(this) %></OutputType>\n <AppDesignerFolder>Properties</AppDesignerFolder>\n <RootNamespace><%= this.buildtarget.basename %></RootNamespace>\n <AssemblyName><%= this.buildtarget.basename %></AssemblyName>\n </PropertyGroup>\n <% for cfg in premake.eachconfig(this) do %>\n <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == '<%= premake.esc(cfg.name) %>|AnyCPU' \">\n <% if cfg.flags.Symbols then %>\n <DebugSymbols>true</DebugSymbols>\n <DebugType>full</DebugType>\n <% else %>\n <DebugType>pdbonly</DebugType>\n <% end %>\n <Optimize><%= iif(cfg.flags.Optimize or cfg.flags.OptimizeSize or cfg.flags.OptimizeSpeed, \"true\", \"false\") %></Optimize>\n <OutputPath><%= cfg.buildtarget.directory %></OutputPath>\n <DefineConstants><%= table.concat(premake.esc(cfg.defines), \";\") %></DefineConstants>\n <ErrorReport>prompt</ErrorReport>\n <WarningLevel>4</WarningLevel>\n <% if cfg.flags.Unsafe then %>\n <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n <% end %>\n <% if cfg.flags.FatalWarnings then %>\n <TreatWarningsAsErrors>true</TreatWarningsAsErrors>\n <% end %>\n </PropertyGroup>\n <% end %>\n <ItemGroup>\n <% for _, prj in ipairs(premake.getlinks(this, \"siblings\", \"object\")) do %>\n <ProjectReference Include=\"<%= path.translate(path.getrelative(this.location, _VS.projectfile(prj)), \"\\\\\") %>\">\n <Project>{<%= prj.uuid %>}</Project>\n <Name><%= premake.esc(prj.name) %></Name>\n </ProjectReference>\n <% end %>\n <% for _, linkname in ipairs(premake.getlinks(this, \"system\", \"basename\")) do %>\n <Reference Include=\"<%= premake.esc(linkname) %>\" />\n <% end %>\n </ItemGroup>\n <ItemGroup>\n <%\n for fcfg in premake.eachfile(this) do\n local action = csc.getbuildaction(fcfg)\n local fname = path.translate(premake.esc(fcfg.name), \"\\\\\")\n local elements, dependency = getelements(this, action, fcfg.name)\n if elements == \"None\" then\n %>\n <<%= action %> Include=\"<%= fname %>\" />\n <% \n else \n %>\n <<%= action %> Include=\"<%= fname %>\">\n <% if elements == \"AutoGen\" then %>\n <AutoGen>True</AutoGen>\n <% elseif elements == \"AutoGenerated\" then %>\n <SubType>Designer</SubType>\n <Generator>ResXFileCodeGenerator</Generator>\n <LastGenOutput><%= premake.esc(path.getbasename(fcfg.name)) %>.Designer.cs</LastGenOutput>\n <% elseif elements == \"SubTypeDesigner\" then %>\n <SubType>Designer</SubType>\n <% elseif elements == \"SubTypeForm\" then %>\n <SubType>Form</SubType>\n <% elseif elements == \"PreserveNewest\" then %>\n <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n <% end %>\n <% if dependency then %> \n <DependentUpon><%= path.translate(premake.esc(dependency), \"\\\\\") %></DependentUpon>\n <% end %>\n </<%= action %>>\n <% \n end \n end\n %>\n </ItemGroup>\n <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n Other similar extension points exist, see Microsoft.Common.targets.\n <Target Name=\"BeforeBuild\">\n </Target>\n <Target Name=\"AfterBuild\">\n </Target>\n -->\n</Project>\n]])",
"_TEMPLATES.vs2005_csproj_user=premake.loadtemplatestring('vs2005_csproj_user',[[<% eol = \"\\r\\n\" %>\n<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n <PropertyGroup>\n <ReferencePath><%= table.concat(table.translate(this.libdirs, function(v) return path.translate(path.getabsolute(this.location..\"/\"..v),\"\\\\\") end), \";\") %></ReferencePath>\n </PropertyGroup>\n</Project> ]])",
- "_TEMPLATES.vs200x_vcproj=premake.loadtemplatestring('vs200x_vcproj',[[<% eol = \"\\r\\n\" %>\n<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n ProjectType=\"Visual C++\"\n<% if _ACTION == \"vs2002\" then %>\n Version=\"7.00\"\n<% elseif _ACTION == \"vs2003\" then %>\n Version=\"7.10\"\n<% elseif _ACTION == \"vs2005\" then %>\n Version=\"8.00\"\n<% elseif _ACTION == \"vs2008\" then %>\n Version=\"9.00\"\n<% end %>\n Name=\"<%= premake.esc(this.name) %>\"\n ProjectGUID=\"{<%= this.uuid %>}\"\n<% if _ACTION > \"vs2003\" then %>\n RootNamespace=\"<%= this.name %>\"\n<% end %>\n Keyword=\"<%= iif(this.flags.Managed, \"ManagedCProj\", \"Win32Proj\") %>\"\n >\n <Platforms>\n <Platform\n Name=\"Win32\"\n />\n </Platforms>\n<% if _ACTION > \"vs2003\" then %>\n <ToolFiles>\n </ToolFiles>\n<% end %>\n <Configurations>\n<% for cfg in premake.eachconfig(this) do %>\n <Configuration\n Name=\"<%= premake.esc(cfg.name) %>|Win32\"\n OutputDirectory=\"<%= premake.esc(cfg.buildtarget.directory) %>\"\n IntermediateDirectory=\"<%= premake.esc(cfg.objectsdir) %>\"\n ConfigurationType=\"<%= _VS.cfgtype(cfg) %>\"\n CharacterSet=\"<%= iif(cfg.flags.Unicode, 1, 2) %>\"\n <% if cfg.flags.Managed then %>\n ManagedExtensions=\"true\"\n <% end %>\n >\n<% for _,block in ipairs(_VS[_ACTION]) do %>\n <% if (block == \"VCALinkTool\") then %>\n <Tool\n Name=\"VCALinkTool\"\n />\n <% elseif (block == \"VCAppVerifierTool\") then %>\n <Tool\n Name=\"VCAppVerifierTool\"\n />\n <% elseif (block == \"VCAuxiliaryManagedWrapperGeneratorTool\") then %>\n <Tool\n Name=\"VCAuxiliaryManagedWrapperGeneratorTool\"\n />\n <% elseif (block == \"VCBscMakeTool\") then %>\n <Tool\n Name=\"VCBscMakeTool\"\n />\n <% elseif (block == \"VCCLCompilerTool\") then %>\n <Tool\n Name=\"VCCLCompilerTool\"\n <% if #cfg.buildoptions > 0 then %>\n AdditionalOptions=\"<%= table.concat(premake.esc(cfg.buildoptions), \" \") %>\"\n <% end %>\n Optimization=\"<%= _VS.optimization(cfg) %>\" \n <% if cfg.flags.NoFramePointer then %>\n OmitFramePointers=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if #cfg.includedirs > 0 then %>\n AdditionalIncludeDirectories=\"<%= table.concat(premake.esc(cfg.includedirs), \";\") %>\"\n <% end %>\n <% if #cfg.defines > 0 then %>\n PreprocessorDefinitions=\"<%= table.concat(premake.esc(cfg.defines), \";\") %>\"\n <% end %>\n <% if cfg.flags.Symbols and not cfg.flags.Managed then %>\n MinimalRebuild=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if cfg.flags.NoExceptions then %>\n ExceptionHandling=\"<%= iif(_ACTION < \"vs2005\", \"FALSE\", 0) %>\"\n <% elseif cfg.flags.SEH and _ACTION > \"vs2003\" then %>\n ExceptionHandling=\"2\"\n <% end %>\n <% if _VS.optimization(cfg) == 0 and not cfg.flags.Managed then %>\n BasicRuntimeChecks=\"3\"\n <% end %>\n <% if _VS.optimization(cfg) ~= 0 then %>\n StringPooling=\"<%= _VS.bool(true) %>\"\n <% end %>\n RuntimeLibrary=\"<%= _VS.runtime(cfg) %>\"\n EnableFunctionLevelLinking=\"<%= _VS.bool(true) %>\"\n <% if _ACTION < \"vs2005\" and not cfg.flags.NoRTTI then %>\n RuntimeTypeInfo=\"<%= _VS.bool(true) %>\"\n <% elseif _ACTION > \"vs2003\" and cfg.flags.NoRTTI then %>\n RuntimeTypeInfo=\"<%= _VS.bool(false) %>\"\n <% end %>\n <% if cfg.flags.NativeWChar then %>\n TreatWChar_tAsBuiltInType=\"<%= _VS.bool(true) %>\"\n <% elseif cfg.flags.NoNativeWChar then %>\n TreatWChar_tAsBuiltInType=\"<%= _VS.bool(false) %>\"\n <% end %>\n <% if not cfg.flags.NoPCH and cfg.pchheader then %>\n UsePrecompiledHeader=\"<%= iif(_ACTION < \"vs2005\", 3, 2) %>\"\n PrecompiledHeaderThrough=\"<%= cfg.pchheader %>\"\n <% else %>\n UsePrecompiledHeader=\"<%= iif(_ACTION > \"vs2003\" or cfg.flags.NoPCH, 0, 2) %>\"\n <% end %>\n WarningLevel=\"<%= iif(cfg.flags.ExtraWarnings, 4, 3) %>\"\n <% if cfg.flags.FatalWarnings then %>\n WarnAsError=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if _ACTION < \"vs2008\" and not cfg.flags.Managed then %>\n Detect64BitPortabilityProblems=\"<%= _VS.bool(not cfg.flags.No64BitChecks) %>\"\n <% end %>\n ProgramDataBaseFileName=\"$(OutDir)\\$(ProjectName).pdb\"\n DebugInformationFormat=\"<%= _VS.symbols(cfg) %>\"\n />\n <% elseif (block == \"VCCustomBuildTool\") then %>\n <Tool\n Name=\"VCCustomBuildTool\"/>\n <% elseif (block == \"VCFxCopTool\") then %>\n <Tool\n Name=\"VCFxCopTool\"\n />\n <% elseif (block == \"VCLinkerTool\") then %>\n <Tool\n <% if cfg.kind ~= \"StaticLib\" then %>\n Name=\"VCLinkerTool\"\n <% if cfg.flags.NoImportLib then %>\n IgnoreImportLibrary=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if #cfg.linkoptions > 0 then %>\n AdditionalOptions=\"<%= table.concat(premake.esc(cfg.linkoptions), \" \") %>\"\n <% end %>\n <% if #cfg.links > 0 then %>\n AdditionalDependencies=\"<%= table.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \" \") %>\"\n <% end %>\n OutputFile=\"$(OutDir)\\<%= cfg.buildtarget.name %>\"\n LinkIncremental=\"<%= iif(_VS.optimization(cfg) == 0, 2, 1) %>\"\n AdditionalLibraryDirectories=\"<%= table.concat(premake.esc(path.translate(cfg.libdirs)) , \";\") %>\"\n <% local deffile = premake.findfile(cfg, \".def\"); if deffile then %>\n ModuleDefinitionFile=\"<%= deffile %>\"\n <% end %>\n <% if cfg.flags.NoManifest then %>\n GenerateManifest=\"<%= _VS.bool(false) %>\"\n <% end %>\n GenerateDebugInformation=\"<%= _VS.bool(_VS.symbols(cfg) ~= 0) %>\"\n <% if _VS.symbols(cfg) ~= 0 then %>\n ProgramDatabaseFile=\"$(OutDir)\\$(ProjectName).pdb\"\n <% end %>\n SubSystem=\"<%= iif(cfg.kind == \"ConsoleApp\", 1, 2) %>\"\n <% if _VS.optimization(cfg) ~= 0 then %>\n OptimizeReferences=\"2\"\n EnableCOMDATFolding=\"2\"\n <% end %>\n <% if (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") and not cfg.flags.WinMain then %>\n EntryPointSymbol=\"mainCRTStartup\"\n <% end %>\n <% if cfg.kind == \"SharedLib\" then %>\n <% local implibname = path.translate(premake.gettarget(cfg, \"link\", \"windows\").fullpath, \"\\\\\") %>\n ImportLibrary=\"<%= iif(cfg.flags.NoImportLib, cfg.objectsdir..\"\\\\\"..path.getname(implibname), implibname) %>\"\n <% end %>\n TargetMachine=\"1\"\n <% else %>\n Name=\"VCLibrarianTool\"\n OutputFile=\"$(OutDir)\\<%= cfg.buildtarget.name %>\"\n <% end %>\n />\n <% elseif (block == \"VCManagedResourceCompilerTool\") then %>\n <Tool\n Name=\"VCManagedResourceCompilerTool\"\n />\n <% elseif (block == \"VCManagedWrapperGeneratorTool\") then %>\n <Tool\n Name=\"VCManagedWrapperGeneratorTool\"\n />\n <% elseif (block == \"VCManifestTool\") then %>\n <Tool\n Name=\"VCManifestTool\"\n />\n <% elseif (block == \"VCMIDLTool\") then %>\n <Tool\n Name=\"VCMIDLTool\"\n />\n <% elseif (block == \"VCPreBuildEventTool\") then %>\n <Tool\n Name=\"VCPreBuildEventTool\"\n <% if #cfg.prebuildcommands > 0 then %>\n CommandLine=\"<%= premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")) %>\"\n <% end %>\n />\n <% elseif (block == \"VCPreLinkEventTool\") then %>\n <Tool\n Name=\"VCPreLinkEventTool\"\n <% if #cfg.prelinkcommands > 0 then %>\n CommandLine=\"<%= premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")) %>\"\n <% end %>\n />\n <% elseif (block == \"VCPostBuildEventTool\") then %>\n <Tool\n Name=\"VCPostBuildEventTool\"\n <% if #cfg.postbuildcommands > 0 then %>\n CommandLine=\"<%= premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")) %>\"\n <% end %>\n />\n <% elseif (block == \"VCResourceCompilerTool\") then %>\n <Tool\n Name=\"VCResourceCompilerTool\"\n <% if #cfg.resoptions > 0 then %>\n AdditionalOptions=\"<%= table.concat(premake.esc(cfg.resoptions), \" \") %>\"\n <% end %>\n <% if #cfg.defines > 0 or #cfg.resdefines > 0 then %>\n PreprocessorDefinitions=\"<%= table.concat(premake.esc(table.join(cfg.defines, cfg.resdefines)), \";\") %>\"\n <% end %>\n <% if #cfg.includedirs > 0 or #cfg.resincludedirs > 0 then %>\n AdditionalIncludeDirectories=\"<%= table.concat(premake.esc(table.join(cfg.includedirs, cfg.resincludedirs)), \";\") %>\"\n <% end %>\n />\n <% elseif (block == \"VCWebDeploymentTool\") then %>\n <Tool\n Name=\"VCWebDeploymentTool\"\n />\n <% elseif (block == \"VCWebServiceProxyGeneratorTool\") then %>\n <Tool\n Name=\"VCWebServiceProxyGeneratorTool\"\n />\n <% elseif (block == \"VCXDCMakeTool\") then %>\n <Tool\n Name=\"VCXDCMakeTool\"\n />\n <% elseif (block == \"VCXMLDataGeneratorTool\") then %>\n <Tool\n Name=\"VCXMLDataGeneratorTool\"\n />\n <% end %>\n<% end %>\n </Configuration>\n <% end %>\n </Configurations>\n <References>\n </References>\n <Files>\n <% premake.walksources(this, this.files, _VS.files) %>\n </Files>\n <Globals>\n </Globals>\n</VisualStudioProject>\n]])",
+ "_TEMPLATES.vs200x_vcproj=premake.loadtemplatestring('vs200x_vcproj',[[<% eol = \"\\r\\n\" %>\n<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n ProjectType=\"Visual C++\"\n<% if _ACTION == \"vs2002\" then %>\n Version=\"7.00\"\n<% elseif _ACTION == \"vs2003\" then %>\n Version=\"7.10\"\n<% elseif _ACTION == \"vs2005\" then %>\n Version=\"8.00\"\n<% elseif _ACTION == \"vs2008\" then %>\n Version=\"9.00\"\n<% end %>\n Name=\"<%= premake.esc(this.name) %>\"\n ProjectGUID=\"{<%= this.uuid %>}\"\n<% if _ACTION > \"vs2003\" then %>\n RootNamespace=\"<%= this.name %>\"\n<% end %>\n Keyword=\"<%= iif(this.flags.Managed, \"ManagedCProj\", \"Win32Proj\") %>\"\n >\n <Platforms>\n <Platform\n Name=\"Win32\"\n />\n </Platforms>\n<% if _ACTION > \"vs2003\" then %>\n <ToolFiles>\n </ToolFiles>\n<% end %>\n <Configurations>\n<% for cfg in premake.eachconfig(this) do %>\n <Configuration\n Name=\"<%= premake.esc(cfg.name) %>|Win32\"\n OutputDirectory=\"<%= premake.esc(cfg.buildtarget.directory) %>\"\n IntermediateDirectory=\"<%= premake.esc(cfg.objectsdir) %>\"\n ConfigurationType=\"<%= _VS.cfgtype(cfg) %>\"\n CharacterSet=\"<%= iif(cfg.flags.Unicode, 1, 2) %>\"\n <% if cfg.flags.Managed then %>\n ManagedExtensions=\"true\"\n <% end %>\n >\n<% for _,block in ipairs(_VS[_ACTION]) do %>\n <% if (block == \"VCALinkTool\") then %>\n <Tool\n Name=\"VCALinkTool\"\n />\n <% elseif (block == \"VCAppVerifierTool\") then %>\n <Tool\n Name=\"VCAppVerifierTool\"\n />\n <% elseif (block == \"VCAuxiliaryManagedWrapperGeneratorTool\") then %>\n <Tool\n Name=\"VCAuxiliaryManagedWrapperGeneratorTool\"\n />\n <% elseif (block == \"VCBscMakeTool\") then %>\n <Tool\n Name=\"VCBscMakeTool\"\n />\n <% elseif (block == \"VCCLCompilerTool\") then %>\n <Tool\n Name=\"VCCLCompilerTool\"\n <% if #cfg.buildoptions > 0 then %>\n AdditionalOptions=\"<%= table.concat(premake.esc(cfg.buildoptions), \" \") %>\"\n <% end %>\n Optimization=\"<%= _VS.optimization(cfg) %>\" \n <% if cfg.flags.NoFramePointer then %>\n OmitFramePointers=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if #cfg.includedirs > 0 then %>\n AdditionalIncludeDirectories=\"<%= table.concat(premake.esc(cfg.includedirs), \";\") %>\"\n <% end %>\n <% if #cfg.defines > 0 then %>\n PreprocessorDefinitions=\"<%= table.concat(premake.esc(cfg.defines), \";\") %>\"\n <% end %>\n <% if cfg.flags.Symbols and not cfg.flags.Managed then %>\n MinimalRebuild=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if cfg.flags.NoExceptions then %>\n ExceptionHandling=\"<%= iif(_ACTION < \"vs2005\", \"FALSE\", 0) %>\"\n <% elseif cfg.flags.SEH and _ACTION > \"vs2003\" then %>\n ExceptionHandling=\"2\"\n <% end %>\n <% if _VS.optimization(cfg) == 0 and not cfg.flags.Managed then %>\n BasicRuntimeChecks=\"3\"\n <% end %>\n <% if _VS.optimization(cfg) ~= 0 then %>\n StringPooling=\"<%= _VS.bool(true) %>\"\n <% end %>\n RuntimeLibrary=\"<%= _VS.runtime(cfg) %>\"\n EnableFunctionLevelLinking=\"<%= _VS.bool(true) %>\"\n <% if _ACTION < \"vs2005\" and not cfg.flags.NoRTTI then %>\n RuntimeTypeInfo=\"<%= _VS.bool(true) %>\"\n <% elseif _ACTION > \"vs2003\" and cfg.flags.NoRTTI then %>\n RuntimeTypeInfo=\"<%= _VS.bool(false) %>\"\n <% end %>\n <% if cfg.flags.NativeWChar then %>\n TreatWChar_tAsBuiltInType=\"<%= _VS.bool(true) %>\"\n <% elseif cfg.flags.NoNativeWChar then %>\n TreatWChar_tAsBuiltInType=\"<%= _VS.bool(false) %>\"\n <% end %>\n <% if not cfg.flags.NoPCH and cfg.pchheader then %>\n UsePrecompiledHeader=\"<%= iif(_ACTION < \"vs2005\", 3, 2) %>\"\n PrecompiledHeaderThrough=\"<%= cfg.pchheader %>\"\n <% else %>\n UsePrecompiledHeader=\"<%= iif(_ACTION > \"vs2003\" or cfg.flags.NoPCH, 0, 2) %>\"\n <% end %>\n WarningLevel=\"<%= iif(cfg.flags.ExtraWarnings, 4, 3) %>\"\n <% if cfg.flags.FatalWarnings then %>\n WarnAsError=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if _ACTION < \"vs2008\" and not cfg.flags.Managed then %>\n Detect64BitPortabilityProblems=\"<%= _VS.bool(not cfg.flags.No64BitChecks) %>\"\n <% end %>\n ProgramDataBaseFileName=\"$(OutDir)\\$(ProjectName).pdb\"\n DebugInformationFormat=\"<%= _VS.symbols(cfg) %>\"\n />\n <% elseif (block == \"VCCustomBuildTool\") then %>\n <Tool\n Name=\"VCCustomBuildTool\"/>\n <% elseif (block == \"VCFxCopTool\") then %>\n <Tool\n Name=\"VCFxCopTool\"\n />\n <% elseif (block == \"VCLinkerTool\") then %>\n <Tool\n <% if cfg.kind ~= \"StaticLib\" then %>\n Name=\"VCLinkerTool\"\n <% if cfg.flags.NoImportLib then %>\n IgnoreImportLibrary=\"<%= _VS.bool(true) %>\"\n <% end %>\n <% if #cfg.linkoptions > 0 then %>\n AdditionalOptions=\"<%= table.concat(premake.esc(cfg.linkoptions), \" \") %>\"\n <% end %>\n <% if #cfg.links > 0 then %>\n AdditionalDependencies=\"<%= table.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \" \") %>\"\n <% end %>\n OutputFile=\"$(OutDir)\\<%= cfg.buildtarget.name %>\"\n LinkIncremental=\"<%= iif(_VS.optimization(cfg) == 0, 2, 1) %>\"\n AdditionalLibraryDirectories=\"<%= table.concat(premake.esc(path.translate(cfg.libdirs)) , \";\") %>\"\n <% local deffile = premake.findfile(cfg, \".def\"); if deffile then %>\n ModuleDefinitionFile=\"<%= deffile %>\"\n <% end %>\n <% if cfg.flags.NoManifest then %>\n GenerateManifest=\"<%= _VS.bool(false) %>\"\n <% end %>\n GenerateDebugInformation=\"<%= _VS.bool(_VS.symbols(cfg) ~= 0) %>\"\n <% if _VS.symbols(cfg) ~= 0 then %>\n ProgramDatabaseFile=\"$(OutDir)\\$(ProjectName).pdb\"\n <% end %>\n SubSystem=\"<%= iif(cfg.kind == \"ConsoleApp\", 1, 2) %>\"\n <% if _VS.optimization(cfg) ~= 0 then %>\n OptimizeReferences=\"2\"\n EnableCOMDATFolding=\"2\"\n <% end %>\n <% if (cfg.kind == \"ConsoleApp\" or cfg.kind == \"WindowedApp\") and not cfg.flags.WinMain then %>\n EntryPointSymbol=\"mainCRTStartup\"\n <% end %>\n <% if cfg.kind == \"SharedLib\" then %>\n <% local implibname = path.translate(premake.gettarget(cfg, \"link\", \"windows\").fullpath, \"\\\\\") %>\n ImportLibrary=\"<%= iif(cfg.flags.NoImportLib, cfg.objectsdir..\"\\\\\"..path.getname(implibname), implibname) %>\"\n <% end %>\n TargetMachine=\"1\"\n <% else %>\n Name=\"VCLibrarianTool\"\n <% if #cfg.links > 0 then %>\n AdditionalDependencies=\"<%= table.concat(premake.getlinks(cfg, \"all\", \"fullpath\"), \" \") %>\"\n <% end %>\n OutputFile=\"$(OutDir)\\<%= cfg.buildtarget.name %>\"\n AdditionalLibraryDirectories=\"<%= table.concat(premake.esc(path.translate(cfg.libdirs)) , \";\") %>\"\n <% end %>\n />\n <% elseif (block == \"VCManagedResourceCompilerTool\") then %>\n <Tool\n Name=\"VCManagedResourceCompilerTool\"\n />\n <% elseif (block == \"VCManagedWrapperGeneratorTool\") then %>\n <Tool\n Name=\"VCManagedWrapperGeneratorTool\"\n />\n <% elseif (block == \"VCManifestTool\") then %>\n <Tool\n Name=\"VCManifestTool\"\n />\n <% elseif (block == \"VCMIDLTool\") then %>\n <Tool\n Name=\"VCMIDLTool\"\n />\n <% elseif (block == \"VCPreBuildEventTool\") then %>\n <Tool\n Name=\"VCPreBuildEventTool\"\n <% if #cfg.prebuildcommands > 0 then %>\n CommandLine=\"<%= premake.esc(table.implode(cfg.prebuildcommands, \"\", \"\", \"\\r\\n\")) %>\"\n <% end %>\n />\n <% elseif (block == \"VCPreLinkEventTool\") then %>\n <Tool\n Name=\"VCPreLinkEventTool\"\n <% if #cfg.prelinkcommands > 0 then %>\n CommandLine=\"<%= premake.esc(table.implode(cfg.prelinkcommands, \"\", \"\", \"\\r\\n\")) %>\"\n <% end %>\n />\n <% elseif (block == \"VCPostBuildEventTool\") then %>\n <Tool\n Name=\"VCPostBuildEventTool\"\n <% if #cfg.postbuildcommands > 0 then %>\n CommandLine=\"<%= premake.esc(table.implode(cfg.postbuildcommands, \"\", \"\", \"\\r\\n\")) %>\"\n <% end %>\n />\n <% elseif (block == \"VCResourceCompilerTool\") then %>\n <Tool\n Name=\"VCResourceCompilerTool\"\n <% if #cfg.resoptions > 0 then %>\n AdditionalOptions=\"<%= table.concat(premake.esc(cfg.resoptions), \" \") %>\"\n <% end %>\n <% if #cfg.defines > 0 or #cfg.resdefines > 0 then %>\n PreprocessorDefinitions=\"<%= table.concat(premake.esc(table.join(cfg.defines, cfg.resdefines)), \";\") %>\"\n <% end %>\n <% if #cfg.includedirs > 0 or #cfg.resincludedirs > 0 then %>\n AdditionalIncludeDirectories=\"<%= table.concat(premake.esc(table.join(cfg.includedirs, cfg.resincludedirs)), \";\") %>\"\n <% end %>\n />\n <% elseif (block == \"VCWebDeploymentTool\") then %>\n <Tool\n Name=\"VCWebDeploymentTool\"\n />\n <% elseif (block == \"VCWebServiceProxyGeneratorTool\") then %>\n <Tool\n Name=\"VCWebServiceProxyGeneratorTool\"\n />\n <% elseif (block == \"VCXDCMakeTool\") then %>\n <Tool\n Name=\"VCXDCMakeTool\"\n />\n <% elseif (block == \"VCXMLDataGeneratorTool\") then %>\n <Tool\n Name=\"VCXMLDataGeneratorTool\"\n />\n <% end %>\n<% end %>\n </Configuration>\n <% end %>\n </Configurations>\n <References>\n </References>\n <Files>\n <% premake.walksources(this, this.files, _VS.files) %>\n </Files>\n <Globals>\n </Globals>\n</VisualStudioProject>\n]])",
"--\n\n\n\nlocal function cleantemplatefiles(this, templates)\nif (templates) then\nfor _,tmpl in ipairs(templates) do\nlocal fname = premake.getoutputname(this, tmpl[1])\nos.remove(fname)\nend\nend\nend\n\n\n\nnewaction {\ntrigger = \"clean\",\ndescription = \"Remove all binaries and generated files\",\ntargetstyle = \"windows\",\n\nexecute = function()\nlocal solutions = { }\nlocal projects = { }\nlocal targets = { }\n\nlocal cwd = os.getcwd()\nlocal function rebase(parent, dir)\nreturn path.rebase(dir, parent.location, cwd)\nend\n\n-- Walk the tree. Build a list of object names to pass to the cleaners,\n-- and delete any toolset agnostic files along the way.\nfor _,sln in ipairs(_SOLUTIONS) do\ntable.insert(solutions, path.join(sln.location, sln.name))\n\nfor prj in premake.eachproject(sln) do\ntable.insert(projects, path.join(prj.location, prj.name))\n\nif (prj.objectsdir) then\nos.rmdir(rebase(prj, prj.objectsdir))\nend\n\nfor cfg in premake.eachconfig(prj) do\ntable.insert(targets, path.join(rebase(cfg, cfg.buildtarget.directory), cfg.buildtarget.basename))\n\n-- remove all possible permutations of the target binary\nos.remove(rebase(cfg, premake.gettarget(cfg, \"build\", \"windows\").fullpath))\nos.remove(rebase(cfg, premake.gettarget(cfg, \"build\", \"linux\", \"linux\").fullpath))\nos.remove(rebase(cfg, premake.gettarget(cfg, \"build\", \"linux\", \"macosx\").fullpath))\nif (cfg.kind == \"WindowedApp\") then\nos.rmdir(rebase(cfg, premake.gettarget(cfg, \"build\", \"linux\", \"linux\").fullpath .. \".app\"))\nend\n\n-- if there is an import library, remove that too\nos.remove(rebase(cfg, premake.gettarget(cfg, \"link\", \"windows\").fullpath))\nos.remove(rebase(cfg, premake.gettarget(cfg, \"link\", \"linux\").fullpath))\n\nos.rmdir(rebase(cfg, cfg.objectsdir))\nend\nend\nend\n\n-- Walk the tree again. Delete templated and toolset-specific files\nfor _,action in pairs(premake.actions) do\nfor _,sln in ipairs(_SOLUTIONS) do\ncleantemplatefiles(sln, action.solutiontemplates)\nfor prj in premake.eachproject(sln) do\ncleantemplatefiles(prj, action.projecttemplates)\nend\nend\n\nif (type(action.onclean) == \"function\") then\naction.onclean(solutions, projects, targets)\nend\nend\nend,\n}\n",
"--\n\n\nnewaction {\ntrigger = \"codeblocks\",\nshortname = \"Code::Blocks\",\ndescription = \"Code::Blocks Studio\",\n\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\n\nvalid_languages = { \"C\", \"C++\" },\n\nvalid_tools = {\ncc = { \"gcc\", \"ow\" },\n},\n\nsolutiontemplates = {\n{ \".workspace\", _TEMPLATES.codeblocks_workspace },\n},\n\nprojecttemplates = {\n{ \".cbp\", _TEMPLATES.codeblocks_cbp },\n},\n\nonclean = function(solutions, projects, targets)\nfor _,name in ipairs(projects) do\nos.remove(name .. \".depend\")\nos.remove(name .. \".layout\")\nend\nend\n}\n",
"--\n\n_CODELITE = { }\n\n\n\nfunction _CODELITE.kind(value)\nif (value == \"ConsoleApp\" or value == \"WindowedApp\") then\nreturn \"Executable\"\nelseif (value == \"StaticLib\") then\nreturn \"Static Library\"\nelseif (value == \"SharedLib\") then\nreturn \"Dynamic Library\"\nend\nend\n\n\n\n\nfunction _CODELITE.files(prj, fname, state, nestlevel)\nlocal indent = string.rep(\" \", nestlevel + 1)\n\nif (state == \"GroupStart\") then\nio.write(indent .. '<VirtualDirectory Name=\"' .. path.getname(fname) .. '\">\\n')\nelseif (state == \"GroupEnd\") then\nio.write(indent .. '</VirtualDirectory>\\n')\nelse\nio.write(indent .. '<File Name=\"' .. fname .. '\"/>\\n')\nend\nend\n\n\n\nnewaction {\ntrigger = \"codelite\",\nshortname = \"CodeLite\",\ndescription = \"CodeLite (experimental)\",\ntargetstyle = \"linux\",\n\nvalid_kinds = { \"ConsoleApp\", \"WindowedApp\", \"StaticLib\", \"SharedLib\" },\n\nvalid_languages = { \"C\", \"C++\" },\n\nvalid_tools = {\ncc = { \"gcc\" },\n},\n\nsolutiontemplates = {\n{ \".workspace\", _TEMPLATES.codelite_workspace },\n},\n\nprojecttemplates = {\n{ \".project\", _TEMPLATES.codelite_project },\n},\n\nonclean = function(solutions, projects, targets)\nfor _,name in ipairs(solutions) do\nos.remove(name .. \"_wsp.mk\")\nos.remove(name .. \".tags\")\nend\nfor _,name in ipairs(projects) do\nos.remove(name .. \".mk\")\nos.remove(name .. \".list\")\nos.remove(name .. \".out\")\nend\nend\n}\n",