diff --git a/src/_premake_init.lua b/src/_premake_init.lua index 12f7e203..927ab445 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -1378,6 +1378,16 @@ } } + api.register { + name = "inlinesvisibility", + scope = "config", + kind = "string", + allowed = { + "Default", + "Hidden" + } + } + ----------------------------------------------------------------------------- -- -- Field name aliases for backward compatibility diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index 446b1b45..5ba2e38d 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -177,6 +177,9 @@ Hidden = "-fvisibility=hidden", Internal = "-fvisibility=internal", Protected = "-fvisibility=protected", + }, + inlinesvisibility = { + Hidden = "-fvisibility-inlines-hidden" } } diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index 3e495f00..922b9bd0 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -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