[cmake-developers] CMAKE_VISIBILITY_INLINES_HIDDEN incorrectly applied to non C++ sources?

Nils Gladitz nilsgladitz at gmail.com
Fri Jan 31 06:39:36 EST 2014


I found CMAKE_VISIBILITY_INLINES_HIDDEN and wanted to replace my custom 
gcc flag with it.

For C it causes the warning: "command line option 
‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C".

Independent of the actual language the code currently seems to apply 
CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN to the compile 
flags. (cmLocalGenerator.cxx AddInlineVisibilityCompileOption())

Is this intended?

CMAKE_<LANG>_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN would fix the 
warning for me since it would be undefined for C.

Nils


More information about the cmake-developers mailing list