-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Conversation
programs/nodeos/CMakeLists.txt
Outdated
|
||
foreach(ADDITIONAL_PLUGIN_SOURCE_DIR ${EOSIO_ADDITIONAL_PLUGINS}) | ||
message(STATUS "[Additional Plugin] source dir: ${ADDITIONAL_PLUGIN_SOURCE_DIR}") | ||
add_subdirectory(${ADDITIONAL_PLUGIN_SOURCE_DIR} ${CMAKE_BINARY_DIR}/additional_plugins/${ADDITIONAL_PLUGIN_SOURCE_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would appear to concatenate the whole path to the additional plugin to the directory. Will this cause problems if the path is relative aka "../../../my_plugin" ?
When I was investigating something similar I used
get_filename_component(plugin_name "${external_plugin_path}" NAME)
to get just the last directory name in the path (aka "my_plugin" in the example) and concatenated that to the CMAKE_BINARY_DIR. It carries the problem of all plugins needing unique directory names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! You right.
I see 2 solution :
- use a random string
- use fixed path + incremental integer (ex plugin_1, plugin_2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wanderingbort done
programs/nodeos/CMakeLists.txt
Outdated
include(additionalPlugin) | ||
|
||
foreach(ADDITIONAL_PLUGIN_SOURCE_DIR ${EOSIO_ADDITIONAL_PLUGINS}) | ||
string(UUID ADDITIONAL_PLUGIN_SOURCE_DIR_MD5 NAMESPACE "00000000-0000-0000-0000-000000000000" NAME ${ADDITIONAL_PLUGIN_SOURCE_DIR} TYPE MD5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like where you went with this, should normalize the input first via get_filename_component( ... ABSOLUTE ... )
?
I assume that ".././my_plugin", "../my_plugin", "../my_plugin/../my_plugin", "..//my_plugin" etc are all going to have different UUIDs if we don't normalize them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary: cmake will fail because you got targets with same name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only to make it all cleaner
@wanderingbort is this stable now and should it be used by the community? |
@gleehokie better after #5229 is resolved |
just run cmake with
$ cmake .. -DEOSIO_ADDITIONAL_PLUGINS="<path_to_source_plugin_0>[;<path_to_source_plugin_1] ..."
First additional plugin ever: https://github.com/asiniscalchi/eosio_sql_plugin
following the line you have to add in the root CMakeList.txt of an additional plugin
eosio_additional_plugin(<plugin_target0>[;<plugin_target1>] ...)
Cheers