Skip to content

Commit 62a27d1

Browse files
authored
Fixed visibility flag output for VS Android projects (#2542)
- Added test for flag output
1 parent fa748f4 commit 62a27d1

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

modules/vstudio/tests/_tests.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ return {
114114
"vc2022/test_toolset_settings.lua",
115115

116116
-- Android projects
117+
"android/test_android_build_settings.lua",
117118
"android/test_android_files.lua",
118119
"android/test_android_project.lua",
119120

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
local p = premake
2+
local suite = test.declare("vstudio_vs2010_android_compile_settings")
3+
local vc2010 = p.vstudio.vc2010
4+
local project = p.project
5+
6+
--
7+
-- Setup
8+
--
9+
10+
local wks, prj
11+
12+
function suite.setup()
13+
p.action.set("vs2015")
14+
system "android"
15+
wks, prj = test.createWorkspace()
16+
end
17+
18+
local function prepare(platform)
19+
local cfg = test.getconfig(prj, "Debug", platform)
20+
vc2010.clCompile(cfg)
21+
end
22+
23+
--
24+
-- Visibility settings should go into AdditionalOptions
25+
--
26+
27+
function suite.additionalOptions_onVisibility()
28+
visibility "Default"
29+
prepare()
30+
test.capture [[
31+
<ClCompile>
32+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
33+
<Optimization>Disabled</Optimization>
34+
<AdditionalOptions>-fvisibility=default %(AdditionalOptions)</AdditionalOptions>
35+
]]
36+
end

modules/vstudio/vs2010_vcxproj.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4474,7 +4474,7 @@
44744474

44754475
-- -fvisibility=<>
44764476
if cfg.visibility ~= nil then
4477-
table.insert(opts, p.tools.gcc.cxxflags.visibility[cfg.visibility])
4477+
table.insert(opts, p.tools.gcc.shared.visibility[cfg.visibility])
44784478
end
44794479

44804480
if #opts > 0 then

0 commit comments

Comments
 (0)