[cmake-developers] VISIBILITY_DEFAULT target property

Stephen Kelly steveire at gmail.com
Sat May 18 06:18:49 EDT 2013


Hi,

I've pushed a VISIBILITY_DEFAULT-property topic to my clone. It adds a 
VISIBILITY_DEFAULT target property which works similar to the 
POSITION_INDEPENDENT_CODE property, and is intended to replace the try-
compiles in GenerateExportHeader.

I assume I can't simply move the try-compiles to the Compiler/* because it's 
to early to use it there?

I can probably get information from the current dashboards to find out which 
compilers support the flag. I can wrap the try-compiles in 

 if (NOT CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY)

to make compilers not covered by the dashboards continue to work as 
currently, if that's required. 

Does it matter from a backward compatibility POV that 
COMPILER_HAS_HIDDEN_VISIBILITY would no longer be in the cache? Should I add 
it to the cache if (CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY) ?

How should visibility-inlines-hidden be handled? Introduce 
CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN and use it if 
VISIBILITY_DEFAULT == "hidden"?

Or should I just drop the idea entirely or create a 
GenerateExportHeader2.cmake to use the new property?

Thanks,

Steve.





More information about the cmake-developers mailing list