Add inlinesvisibility API + implement for gcc

This commit is contained in:
thomas desveaux 2018-04-12 19:44:38 +02:00 committed by Thomas Desveaux
parent 2dfa956d2b
commit 259f11846b
3 changed files with 31 additions and 0 deletions

View File

@ -1378,6 +1378,16 @@
}
}
api.register {
name = "inlinesvisibility",
scope = "config",
kind = "string",
allowed = {
"Default",
"Hidden"
}
}
-----------------------------------------------------------------------------
--
-- Field name aliases for backward compatibility

View File

@ -177,6 +177,9 @@
Hidden = "-fvisibility=hidden",
Internal = "-fvisibility=internal",
Protected = "-fvisibility=protected",
},
inlinesvisibility = {
Hidden = "-fvisibility-inlines-hidden"
}
}

View File

@ -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