diff options
author | Oliver Schneider <oliver@assarbad.net> | 2022-01-27 01:39:18 +0300 |
---|---|---|
committer | Oliver Schneider <oliver@assarbad.net> | 2022-01-27 01:39:18 +0300 |
commit | f691e448fa4fd2fb96684612834f29d89a5e2d2b (patch) | |
tree | e686ccad3e844d4e5f97b706521305aa4915fe19 /src/actions | |
parent | 6fc7c197cdf956a451d8ae7f21fb719e01581e0b (diff) |
Decomposing some logic, so I can hook into the per-file options
--HG--
branch : WDS-build
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/vstudio/vs200x_vcproj.lua | 6 | ||||
-rw-r--r-- | src/actions/vstudio/vs2010_vcxproj.lua | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index d119fa6..6de635d 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -102,6 +102,7 @@ _p(3,'>') end + vc200x.individualSourceFileOptions = nil function vc200x.individualSourceFile(prj, depth, fname, node) -- handle file configuration stuff. This needs to be cleaned up and simplified. @@ -114,7 +115,7 @@ local isSourceCode = path.iscppfile(fname) local needsCompileAs = (path.iscfile(fname) ~= premake.project.iscproject(prj)) - if usePCH or (isSourceCode and needsCompileAs) then + if usePCH or (isSourceCode and needsCompileAs) or (type(vc200x.individualSourceFileOptions) == 'function') then _p(depth, '<FileConfiguration') _p(depth, '\tName="%s"', cfginfo.name) _p(depth, '\t>') @@ -138,6 +139,9 @@ _p(depth, '\t\tUsePrecompiledHeader="1"') end end + if (type(vc200x.individualSourceFileOptions) == 'function') then + vc200x.individualSourceFileOptions(prj, depth, fname, node) + end _p(depth, '\t/>') _p(depth, '</FileConfiguration>') diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index c776b30..04deecd 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -526,6 +526,8 @@ end end + vc2010.individualSourceFileOptions = nil + function vc2010.individualSourceFile(prj, config_mappings, file) local configs = prj.solution.vstudio_configs local translatedpath = path.translate(file.name, "\\") @@ -539,6 +541,9 @@ if path.iscfile(file.name) ~= premake.project.iscproject(prj) then _p(3,'<CompileAs>%s</CompileAs>', iif(path.iscfile(file.name), 'CompileAsC', 'CompileAsCpp')) end + if (type(vc2010.individualSourceFileOptions) == 'function') then + vc2010.individualSourceFileOptions(prj, config_mappings, file) + end _p(2,'</ClCompile>') end |