Android projects use IncludePath instead of ExternalIncludePath

This commit is contained in:
Sam Surtees 2022-10-05 02:35:09 +10:00
parent 261b627f54
commit a5eba3423a
2 changed files with 34 additions and 0 deletions

View File

@ -26,6 +26,11 @@
vc2010.globals(prj)
end
local function prepareOutputProperties()
local cfg = test.getconfig(prj, "Debug")
vc2010.outputProperties(cfg)
end
function suite.minVisualStudioVersion_14()
prepareGlobals()
test.capture [[
@ -148,3 +153,17 @@
<CppLanguageStandard>c++1z</CppLanguageStandard>
]]
end
function suite.externalIncludeDirs()
externalincludedirs { "externalincludedirs" }
prepareOutputProperties()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Android'">
<LinkIncremental>true</LinkIncremental>
<IntDir>obj\Debug\</IntDir>
<TargetName>MyProject</TargetName>
<TargetExt>
</TargetExt>
<IncludePath>externalincludedirs;$(IncludePath)</IncludePath>
]]
end

View File

@ -640,3 +640,18 @@ end)
return oldfn(cfg)
end
end)
--
-- Disable usage of ExternalIncludePath, Android project format ignores it.
--
p.override(vc2010, "includePath", function(oldfn, cfg)
if cfg.system == p.ANDROID then
local dirs = vstudio.path(cfg, cfg.externalincludedirs)
if #dirs > 0 then
vc2010.element("IncludePath", nil, "%s;$(IncludePath)", table.concat(dirs, ";"))
end
else
oldfn(cfg)
end
end)