-
-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate mapping table generation for plugins
Add plugin name in plugins.conf to enable the plugin Mapping table will generate object for the respective plugin and register the service
- Loading branch information
Showing
3 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
file(STRINGS ../proto/plugins.conf plugins_list) | ||
|
||
foreach(plugin ${plugins_list}) | ||
string(SUBSTRING ${plugin} 0 1 FIRST_LETTER) | ||
string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) | ||
string(REGEX REPLACE "^.(.*)" "${FIRST_LETTER}\\1" class_name "${plugin}") | ||
set(PLUGIN_MAP_APPEND_STRING "${PLUGIN_MAP_APPEND_STRING} map[\"${plugin}\"] = &createInstances<${class_name}RPCImpl>;\n") | ||
endforeach() | ||
|
||
configure_file(dronecore_server.cpp.in dronecore_server.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters