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:
Diffstat (limited to 'src/actions/vstudio/vs200x_vcproj.lua')
-rw-r--r--src/actions/vstudio/vs200x_vcproj.lua86
1 files changed, 45 insertions, 41 deletions
diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua
index 91e4cb1..fbef6a6 100644
--- a/src/actions/vstudio/vs200x_vcproj.lua
+++ b/src/actions/vstudio/vs200x_vcproj.lua
@@ -103,6 +103,50 @@
end
+ function vc200x.individualSourceFile(prj, depth, fname)
+ -- handle file configuration stuff. This needs to be cleaned up and simplified.
+ -- configurations are cached, so this isn't as bad as it looks
+ for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
+ if cfginfo.isreal then
+ local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
+
+ local usePCH = (not prj.flags.NoPCH and prj.pchsource == node.cfg.name)
+ local isSourceCode = path.iscppfile(fname)
+ local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj))
+
+ if usePCH or (isSourceCode and needsCompileAs) then
+ _p(depth, '<FileConfiguration')
+ _p(depth, '\tName="%s"', cfginfo.name)
+ _p(depth, '\t>')
+ _p(depth, '\t<Tool')
+ _p(depth, '\t\tName="%s"', iif(cfg.system == "Xbox360",
+ "VCCLX360CompilerTool",
+ "VCCLCompilerTool"))
+ if needsCompileAs then
+ _p(depth, '\t\tCompileAs="%s"', iif(path.iscfile(fname), 1, 2))
+ end
+
+ if usePCH then
+ if cfg.system == "PS3" then
+ local options = table.join(premake.snc.getcflags(cfg),
+ premake.snc.getcxxflags(cfg),
+ cfg.buildoptions)
+ options = table.concat(options, " ");
+ options = options .. ' --create_pch="$(IntDir)/$(TargetName).pch"'
+ _p(depth, '\t\tAdditionalOptions="%s"', premake.esc(options))
+ else
+ _p(depth, '\t\tUsePrecompiledHeader="1"')
+ end
+ end
+
+ _p(depth, '\t/>')
+ _p(depth, '</FileConfiguration>')
+ end
+
+ end
+ end
+ end
+
--
-- Write out the <Files> element.
--
@@ -132,47 +176,7 @@
_p(depth, '\t>')
depth = depth + 1
- -- handle file configuration stuff. This needs to be cleaned up and simplified.
- -- configurations are cached, so this isn't as bad as it looks
- for _, cfginfo in ipairs(prj.solution.vstudio_configs) do
- if cfginfo.isreal then
- local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform)
-
- local usePCH = (not prj.flags.NoPCH and prj.pchsource == node.cfg.name)
- local isSourceCode = path.iscppfile(fname)
- local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj))
-
- if usePCH or (isSourceCode and needsCompileAs) then
- _p(depth, '<FileConfiguration')
- _p(depth, '\tName="%s"', cfginfo.name)
- _p(depth, '\t>')
- _p(depth, '\t<Tool')
- _p(depth, '\t\tName="%s"', iif(cfg.system == "Xbox360",
- "VCCLX360CompilerTool",
- "VCCLCompilerTool"))
- if needsCompileAs then
- _p(depth, '\t\tCompileAs="%s"', iif(path.iscfile(fname), 1, 2))
- end
-
- if usePCH then
- if cfg.system == "PS3" then
- local options = table.join(premake.snc.getcflags(cfg),
- premake.snc.getcxxflags(cfg),
- cfg.buildoptions)
- options = table.concat(options, " ");
- options = options .. ' --create_pch="$(IntDir)/$(TargetName).pch"'
- _p(depth, '\t\tAdditionalOptions="%s"', premake.esc(options))
- else
- _p(depth, '\t\tUsePrecompiledHeader="1"')
- end
- end
-
- _p(depth, '\t/>')
- _p(depth, '</FileConfiguration>')
- end
-
- end
- end
+ vc200x.individualSourceFile(prj, depth, fname)
depth = depth - 1
_p(depth, '</File>')