[vtk-developers] Visibility flags and C

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Aug 15 16:11:13 EDT 2012


On Wed, Aug 15, 2012 at 2:49 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> I'm wondering if someone can provide insight into this compiler
> warning that I'm seeing:
>
>  cc1: warning: command line option "-fvisibility-inlines-hidden" is
>  valid for C++/ObjC++ but not for C
>
> I'm building a module library with vtk_module_library(), where the
> source files are all in C (no C++).  It seems that the flags
> "-fvisibility=hidden -fvisibility-inlines-hidden" are automatically
> being added by a cmake macro somewhere.
>
> This is with VTK master and cmake 2.8.9, with gcc 4.2 on linux.
>
I think we are doing this for all VTK libraries that are built shared,
and I didn't account for C only libraries. Is there a good way to tell
if a target is a C only library from the CMake level for things like
this?

Marcus



More information about the vtk-developers mailing list