Skip to content

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

Merged
merged 3 commits into from
Apr 22, 2021

Conversation

intjftw
Copy link
Collaborator

@intjftw intjftw commented Apr 13, 2021

I added a WITH_PLUGIN and a WITHOUT_PLUGIN option to the cmake command. By using WITH_PLUGIN, the user can specify the plugins they want to build. By using WITHOUT_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.

@intjftw intjftw added Kind: Enhancement 🌟 Target: Developer environment Developer environment issues consist of CodeCompass or 3rd-party build tooling, configuration or CI. labels Apr 13, 2021
@intjftw intjftw added this to the Release Flash milestone Apr 13, 2021
@intjftw intjftw requested review from mcserep and bruntib April 13, 2021 15:56
Comment on lines 16 to 17
message(WARNING "The search and metrics plugins cannot be left out, "
"they will be compiled anyway.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emphasise they are options:

Suggested change
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.")

Comment on lines 30 to 31
message(WARNING "The search and metrics plugins cannot be left out, "
"they will be compiled anyway.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.")

Comment on lines 33 to 40
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()
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

@mcserep mcserep left a 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.

@intjftw intjftw force-pushed the conditional_compilation branch from 15884a7 to 34765c3 Compare April 21, 2021 16:10
@mcserep mcserep merged commit 2a2a3b2 into Ericsson:master Apr 22, 2021
@mcserep mcserep deleted the conditional_compilation branch January 4, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Enhancement 🌟 Target: Developer environment Developer environment issues consist of CodeCompass or 3rd-party build tooling, configuration or CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants