-
Notifications
You must be signed in to change notification settings - Fork 104
Conditional compilation of plugins #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
plugins/CMakeLists.txt
Outdated
message(WARNING "The search and metrics plugins cannot be left out, " | ||
"they will be compiled anyway.") |
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.
Emphasise they are options:
message(WARNING "The search and metrics plugins cannot be left out, " | |
"they will be compiled anyway.") | |
message(WARNING "The 'search' and 'metrics' plugins cannot be left out, " | |
"they will be compiled anyway.") |
plugins/CMakeLists.txt
Outdated
message(WARNING "The search and metrics plugins cannot be left out, " | ||
"they will be compiled anyway.") |
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.
message(WARNING "The search and metrics plugins cannot be left out, " | |
"they will be compiled anyway.") | |
message(WARNING "The 'search' and 'metrics' plugins cannot be left out, " | |
"they will be compiled anyway.") |
plugins/CMakeLists.txt
Outdated
foreach(_plugin ${plugins}) | ||
if(("${_plugin}" IN_LIST WITHOUT_PLUGIN) | ||
AND NOT ("${_plugin}" STREQUAL "metrics") | ||
AND NOT ("${_plugin}" STREQUAL "search") | ||
AND (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_plugin}")) | ||
list(REMOVE_ITEM plugins ${_plugin}) | ||
endif() | ||
endforeach() |
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.
Can we factor this loop out from the if()
s? The hardcoded keeping of search
and metrics
and everything else is duplicated in here.
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 refactored it, however, I think it is less readable this way.
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.
Looks good for me with the modifications.
15884a7
to
34765c3
Compare
I added a
WITH_PLUGIN
and aWITHOUT_PLUGIN
option to the cmake command. By usingWITH_PLUGIN
, the user can specify the plugins they want to build. By usingWITHOUT_PLUGIN
, the user can specify the plugins they don't want to build. The options cannot be used together at the same time. If neither is specified, all plugins are to be built.