Skip to content

Commit

Permalink
Add inlinesvisibility API + implement for gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas desveaux committed Apr 12, 2018
1 parent dc641e5 commit dc9b9df
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/_premake_init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,16 @@
kind = "boolean",
}

api.register {
name = "inlinesvisibility",
scope = "config",
kind = "string",
allowed = {
"Default",
"Hidden"
}
}

-----------------------------------------------------------------------------
--
-- Field name aliases for backward compatibility
Expand Down
3 changes: 3 additions & 0 deletions src/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
},
rtti = {
Off = "-fno-rtti"
},
inlinesvisibility = {
Hidden = "-fvisibility-inlines-hidden"
}
}

Expand Down
18 changes: 18 additions & 0 deletions tests/tools/test_gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -808,3 +808,21 @@
test.contains({ "-fno-unsigned-char" }, gcc.getcxxflags(cfg))
test.contains({ "-fno-unsigned-char" }, gcc.getcflags(cfg))
end

--
-- Test inlines visibility flags.
--

function suite.cxxflags_onInlinesVisibilityDefault()
inlinesvisibility "Default"
prepare()
test.excludes({ "-fvisibility-inlines-hidden" }, gcc.getcflags(cfg))
test.excludes({ "-fvisibility-inlines-hidden" }, gcc.getcxxflags(cfg))
end

function suite.cxxflags_onInlinesVisibilityHidden()
inlinesvisibility "Hidden"
prepare()
test.excludes({ "-fvisibility-inlines-hidden" }, gcc.getcflags(cfg))
test.contains({ "-fvisibility-inlines-hidden" }, gcc.getcxxflags(cfg))
end

0 comments on commit dc9b9df

Please sign in to comment.