option (WITH_CLIENT_LIB "Build LayerManagement Client Lib" ON)
option (WITH_COMMUNICATOR_GEN "Build Generic Communicator Plugin" ON)
-option (WITH_PLUGIN_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd health monitoring" OFF)
+option (WITH_SYSTEMD_HEALTH_MONITOR "Build plugin for systemd health monitoring" OFF)
option (WITH_TEXT_RENDERER "Build renderer renderer (only logging)" OFF)
-option (WITH_PLUGIN_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin for example applciations" OFF)
+option (WITH_EXAMPLE_SCENE_PROVIDER "Build scene provider plugin for example applciations" OFF)
+
+option (WITH_STATIC_PLUGINS "Link all plugins statically" OFF)
#==============================================================================
set (WITH_WAYLAND OFF)
set (BUILD_UTILS_LIB OFF)
set (INSTALL_UTILS_LIB OFF)
+set (STATICALLY_LINKED_PLUGINS "" CACHE INTERNAL "list of static plugins" FORCE)
#==============================================================================
# set default build parameters
#==============================================================================
add_subdirectory(cmake/optionalFeatures)
-add_subdirectory(config)
include_directories ("${PROJECT_SOURCE_DIR}/config")
include_directories ("${PROJECT_SOURCE_DIR}/3rdParty/")
#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
#==============================================================================
-if (WITH_PLUGIN_EXAMPLE_SCENE_PROVIDER)
+if (WITH_EXAMPLE_SCENE_PROVIDER)
add_subdirectory (LayerManagerPlugins/SceneProvider/ExampleSceneProvider)
-endif(WITH_PLUGIN_EXAMPLE_SCENE_PROVIDER)
+endif(WITH_EXAMPLE_SCENE_PROVIDER)
-if (WITH_PLUGIN_SYSTEMD_HEALTH_MONITOR)
+if (WITH_SYSTEMD_HEALTH_MONITOR)
add_subdirectory (LayerManagerPlugins/HealthMonitor/SystemdHealthMonitor)
-endif(WITH_PLUGIN_SYSTEMD_HEALTH_MONITOR)
+endif(WITH_SYSTEMD_HEALTH_MONITOR)
if (WITH_COMMUNICATOR_GEN)
add_subdirectory (LayerManagerCommands)
if (WITH_TESTS)
enable_testing()
endif(WITH_TESTS)
+
+#==============================================================================
+# store used build configuration
+#==============================================================================
+add_subdirectory(config)
{ DEBUG_FLAG, "WITH_WAYLAND_X11 = ${WITH_WAYLAND_X11}" },
{ DEBUG_FLAG, "WITH_WL_EXAMPLE = ${WITH_WL_EXAMPLE}" },
{ DEBUG_FLAG, "WITH_X11_GLES = ${WITH_X11_GLES}" },
- { DEBUG_FLAG, "WITH_PLUGIN_SYSTEMD.. = ${WITH_PLUGIN_SYSTEMD_HEALTH_MONITOR}" }
+ { DEBUG_FLAG, "WITH_SYSTEMD_HEALTH_MONITOR = ${WITH_SYSTEMD_HEALTH_MONITOR}" },
+ { DEBUG_FLAG, "WITH_EXAMPLE_SCENE_PROVIDER = ${WITH_EXAMPLE_SCENE_PROVIDER}" },
+ { DEBUG_FLAG, "WITH_STATIC_PLUGINS = ${WITH_STATIC_PLUGINS}" }
};
const int gBuildFlagCount = sizeof(gBuildFlags) / sizeof(gBuildFlags[0]);
+
+//-----------------------------------------------------------------------------
+// manage list of statically linked plugins
+//-----------------------------------------------------------------------------
+#define REGISTER_PLUGIN(PLUGIN) \
+ extern "C" IPlugin* create ## PLUGIN(ICommandExecutor& executor, Configuration& config); \
+ static bool PLUGIN ## _instance = PluginManager::registerStaticPluginCreateFunction(create ## PLUGIN);
+
+#define STATIC_PLUGIN_REGISTRATION ${STATIC_PLUGIN_REGISTRATION}
+
+//-----------------------------------------------------------------------------
+// define plugin entry point depending on build settings
+//-----------------------------------------------------------------------------
+#define DECLARE_LAYERMANAGEMENT_PLUGIN(name) \
+extern "C" IPlugin* create ## name(ICommandExecutor& executor, Configuration& config) \
+{ \
+ return new name(executor, config); \
+}
+
#endif // __CONFIG_H__