Skip to content

Commit

Permalink
Don't output PlatformToolset when toolchainversion isn't specified (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
pdoane-blizzard authored and TurkeyMan committed Jan 17, 2019
1 parent 2648ade commit 7ed2203
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
19 changes: 17 additions & 2 deletions modules/android/tests/test_config_props.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Clang_3_8</PlatformToolset>
</PropertyGroup>
]]
end
Expand All @@ -51,7 +50,23 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Clang_3_8</PlatformToolset>
</PropertyGroup>
]]
end

--
-- Check toolchainversion
--

function suite.toolchainversion_clang_5_0()
toolchainversion '5.0'
prepare()
test.capture [[
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Android'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Clang_5_0</PlatformToolset>
</PropertyGroup>
]]
end
Expand Down
16 changes: 8 additions & 8 deletions modules/android/vsandroid_vcxproj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,27 +142,27 @@

if _ACTION >= "vs2015" then
local gcc_map = {
["_"] = "GCC_4_9", -- default
["4.6"] = "GCC_4_6",
["4.8"] = "GCC_4_8",
["4.9"] = "GCC_4_9",
}
local clang_map = {
["_"] = "Clang_3_8", -- default
["3.4"] = "Clang_3_4",
["3.5"] = "Clang_3_5",
["3.6"] = "Clang_3_6",
["3.8"] = "Clang_3_8",
["5.0"] = "Clang_5_0",
}

local map = iif(cfg.toolset == "gcc", gcc_map, clang_map)
local ts = map[cfg.toolchainversion or "_"]
if ts == nil then
p.error('Invalid toolchainversion for the selected toolset (%s).', cfg.toolset or "clang")
end
if cfg.toolchainversion ~= nil then
local map = iif(cfg.toolset == "gcc", gcc_map, clang_map)
local ts = map[cfg.toolchainversion]
if ts == nil then
p.error('Invalid toolchainversion for the selected toolset (%s).', cfg.toolset or "clang")
end

vc2010.element("PlatformToolset", nil, ts)
vc2010.element("PlatformToolset", nil, ts)
end
else
local archMap = {
arm = "armv5te", -- should arm5 be default? vs-android thinks so...
Expand Down

0 comments on commit 7ed2203

Please sign in to comment.