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 18, 2018
1 parent 2dfa956 commit 259f118
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 @@ -1378,6 +1378,16 @@
}
}

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 @@ -177,6 +177,9 @@
Hidden = "-fvisibility=hidden",
Internal = "-fvisibility=internal",
Protected = "-fvisibility=protected",
},
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 @@ -867,3 +867,21 @@
test.excludes({ "-fvisibility=protected" }, gcc.getcflags(cfg))
test.contains({ "-fvisibility=protected" }, gcc.getcxxflags(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 259f118

Please sign in to comment.