Skip to content

Commit

Permalink
[vs2010+] Handle compileas for files with "unknown" extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Mar 22, 2024
1 parent ac27f70 commit 87f3620
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 87f3620

Please sign in to comment.