Commit 7f123f0b authored by Ben Boeckel's avatar Ben Boeckel

vtkPVPlugin: use the plugin's build type for global functions

parent 9bfa29d8
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
#cmakedefine01 _paraview_add_plugin_with_ui #cmakedefine01 _paraview_add_plugin_with_ui
#cmakedefine01 _paraview_add_plugin_with_xml #cmakedefine01 _paraview_add_plugin_with_xml
#define PARAVIEW_BUILDING_PLUGIN
#define PARAVIEW_PLUGIN_BUILT_SHARED _paraview_add_plugin_built_shared
#include "vtkPVPlugin.h" #include "vtkPVPlugin.h"
#if _paraview_add_plugin_with_ui #if _paraview_add_plugin_with_ui
......
...@@ -160,20 +160,22 @@ private: ...@@ -160,20 +160,22 @@ private:
typedef vtkPVPlugin*(C_DECL* pv_plugin_query_instance_fptr)(); typedef vtkPVPlugin*(C_DECL* pv_plugin_query_instance_fptr)();
#endif #endif
#ifdef PARAVIEW_BUILDING_PLUGIN
// vtkPVPluginLoader checks for existence of this function // vtkPVPluginLoader checks for existence of this function
// to determine if the shared-library is a paraview-server-manager plugin or // to determine if the shared-library is a paraview-server-manager plugin or
// not. The returned value is used to match paraview version/compiler version // not. The returned value is used to match paraview version/compiler version
// etc. These global functions are added only for shared builds. In static // etc. These global functions are added only for shared builds. In static
// builds, plugins cannot be loaded at runtime (only at compile time) so // builds, plugins cannot be loaded at runtime (only at compile time) so
// verification is not necessary. // verification is not necessary.
#ifdef BUILD_SHARED_LIBS #if PARAVIEW_PLUGIN_BUILT_SHARED
#define _PV_PLUGIN_GLOBAL_FUNCTIONS(PLUGIN) \ #define _PV_PLUGIN_GLOBAL_FUNCTIONS(PLUGIN) \
C_EXPORT vtkPVPlugin* C_DECL pv_plugin_instance() { return pv_plugin_instance_##PLUGIN(); } C_EXPORT vtkPVPlugin* C_DECL pv_plugin_instance() { return pv_plugin_instance_##PLUGIN(); }
#else // BUILD_SHARED_LIBS #else
// define empty export. When building static, we don't want to define the global // define empty export. When building static, we don't want to define the global
// functions. // functions.
#define _PV_PLUGIN_GLOBAL_FUNCTIONS(PLUGIN) #define _PV_PLUGIN_GLOBAL_FUNCTIONS(PLUGIN)
#endif // BUILD_SHARED_LIBS #endif
// vtkPVPluginLoader uses this function to obtain the vtkPVPlugin instance for // vtkPVPluginLoader uses this function to obtain the vtkPVPlugin instance for
// this plugin. In a plugin, there can only be one call to this macro. When // this plugin. In a plugin, there can only be one call to this macro. When
...@@ -198,5 +200,7 @@ typedef vtkPVPlugin*(C_DECL* pv_plugin_query_instance_fptr)(); ...@@ -198,5 +200,7 @@ typedef vtkPVPlugin*(C_DECL* pv_plugin_query_instance_fptr)();
#define PV_PLUGIN_IMPORT(PLUGIN) vtkPVPlugin::ImportPlugin(pv_plugin_instance_##PLUGIN()); #define PV_PLUGIN_IMPORT(PLUGIN) vtkPVPlugin::ImportPlugin(pv_plugin_instance_##PLUGIN());
#endif
#endif // vtkPVPlugin_h #endif // vtkPVPlugin_h
// VTK-HeaderTest-Exclude: vtkPVPlugin.h // VTK-HeaderTest-Exclude: vtkPVPlugin.h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment