Setup proper symbol visibility flags for all header classes
VTK-m libraries are built with the default symbol visibility settings of hidden by default ( https://gcc.gnu.org/wiki/Visibility ). This means that template classes that are defined in VTK-m headers are defined with hidden visibility when we are building VTK-m.
Now the challenge is that downstream consumers of VTK-m also must setup their projects to also use a default symbol visibility of hidden, otherwise they will get warnings such as:
ld: warning: <some symbol> has different visibility (default) in <path/to/library.a> and (hidden) in <path/to/my/class.o>
Now this warning means that the vague linkage information for a symbol is conflicting and potentially bad things could occur ( run time crashes, nasal demons, and whatnot ). When you build a class with hidden visibility you are making a contract to state that this classes RTTI
will be kept inside the library it was constructed in. Now obviously this can be problematic if you start throwing around data objects inside a large project that require dynamic cast and use VTK-m data structures
The current solution to this problem is instead of using fvisibility=hidden
VTK-m instead will explicitly state on all classes what the visibility settings should be. These export macro will be named VTKM_HEADER_EXPORT
and VTKM_NO_EXPORT
. With the goal of consistenly defining the visibility of all classes in VTK-m no matter how the project is being used ( or platform / compiler ).