Merge pull request #1044 from tdesveauxPKFX/visibility-hidden
Add Visibility API for gcc/clang toolsets
This commit is contained in:
commit
2dfa956d2b
@ -1366,6 +1366,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "visibility",
|
||||
scope = "config",
|
||||
kind = "string",
|
||||
allowed = {
|
||||
"Default",
|
||||
"Hidden",
|
||||
"Internal",
|
||||
"Protected"
|
||||
}
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
--
|
||||
-- Field name aliases for backward compatibility
|
||||
|
@ -171,6 +171,12 @@
|
||||
},
|
||||
rtti = {
|
||||
Off = "-fno-rtti"
|
||||
},
|
||||
visibility = {
|
||||
Default = "-fvisibility=default",
|
||||
Hidden = "-fvisibility=hidden",
|
||||
Internal = "-fvisibility=internal",
|
||||
Protected = "-fvisibility=protected",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,7 +320,6 @@
|
||||
test.contains({ "-fno-stack-protector" }, gcc.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check the basic translation of LDFLAGS for a Posix system.
|
||||
--
|
||||
@ -836,3 +835,35 @@
|
||||
test.contains({ "-fno-omit-frame-pointer" }, gcc.getcxxflags(cfg))
|
||||
test.contains({ "-fno-omit-frame-pointer" }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
--
|
||||
-- Test visibility.
|
||||
--
|
||||
|
||||
function suite.cxxflags_onVisibilityDefault()
|
||||
visibility "Default"
|
||||
prepare()
|
||||
test.excludes({ "-fvisibility=default" }, gcc.getcflags(cfg))
|
||||
test.contains({ "-fvisibility=default" }, gcc.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onVisibilityHidden()
|
||||
visibility "Hidden"
|
||||
prepare()
|
||||
test.excludes({ "-fvisibility=hidden" }, gcc.getcflags(cfg))
|
||||
test.contains({ "-fvisibility=hidden" }, gcc.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onVisibilityInternal()
|
||||
visibility "Internal"
|
||||
prepare()
|
||||
test.excludes({ "-fvisibility=internal" }, gcc.getcflags(cfg))
|
||||
test.contains({ "-fvisibility=internal" }, gcc.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onVisibilityProtected()
|
||||
visibility "Protected"
|
||||
prepare()
|
||||
test.excludes({ "-fvisibility=protected" }, gcc.getcflags(cfg))
|
||||
test.contains({ "-fvisibility=protected" }, gcc.getcxxflags(cfg))
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user