-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[vcpkg] Add vcpkg_check_features #6958
Conversation
I still have the following concerns:
|
I'm not sure having two separate macros is needed. I lean toward just |
@Rastaban Thanks! That sounds resonable to me. |
TODO: Take this form into consideration: if(<option> MATCHES "ON")
endif() https://github.com/microsoft/mimalloc/blob/91222691cb21a6fb7a9760a264ff1183a1237fd4/CMakeLists.txt#L45 |
Agreed with @Rastaban, drop the singular version. |
@cbezault Thanks for your reply! |
## ) | ||
## ``` | ||
## | ||
## `vcpkg_check_feature` accepts a list of (feature, output_variable) pairs. |
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.
vcpkg_check_features
Could you modify one port to use this new feature and add it to this PR? |
Thanks! Done. |
Oops! It seems that I made a mistake here: if("non-posix" IN_LIST FEATURES)
set(ENABLE_POSIX_API OFF) # Not `ON` here
else()
set(ENABLE_POSIX_API ON)
endif() can not be replaced with: vcpkg_check_features(non-posix ENABLE_POSIX_API) I will fix it. |
When working on #4979, I realized this pattern has been repeated too much:
So it is time to create a little shiny macro/function for this.
czmq
has a lot of optional libraries:This patch provides a macro(vcpkg_check_feature) and a function(vcpkg_check_features). With the help of this new module, it can be simplified as:
or