Skip to content

Commit

Permalink
Merge pull request #2195 from Jarod42/vs_compileas
Browse files Browse the repository at this point in the history
[vs2010+] Handle `compileas` for files with "unknown" extensions.
  • Loading branch information
samsinsane committed Mar 23, 2024
2 parents ac27f70 + 87f3620 commit d1f2f0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/vstudio/tests/vc2010/test_files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,18 @@
]]
end

function suite.onCompileAsExt()
files { "hello.unknown_ext" }
filter "files:hello.unknown_ext"
compileas "C++"
prepare()
test.capture [[
<ItemGroup>
<ClCompile Include="hello.unknown_ext">
<CompileAs>CompileAsCpp</CompileAs>
]]
end

--
-- Check handling of per-file cdialect.
--
Expand Down
4 changes: 4 additions & 0 deletions modules/vstudio/vs2010_vcxproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,10 @@
if fcfg.buildaction then
return m.categories[fcfg.buildaction] or m.categories.None
end

if fcfg.compileas ~= nil and fcfg.compileas ~= "Default" then
return m.categories.ClCompile
end
end
end

Expand Down

0 comments on commit d1f2f0a

Please sign in to comment.