-
Notifications
You must be signed in to change notification settings - Fork 54
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
Support semicolon-separated lists in SKBUILD_CMAKE_ARGS #927
Comments
This was recently implemented: #921. How it works for environment variable definition, that I am not so sure though, can you test it against the |
Sure I can test that, although I wouldn't expect that to work. That is implementing the behavior of CMake defines, not the more general case of arbitrary CMake arguments. That being said, if that works it would address the example I showed above since both |
Why wouldn't it? Like passing multiple args doesn't work or passing a value with semicolon doesn't work? If the former that would seem like a bug, at least through my reading of the documentation, didn't check the implementation. If the latter, we should check what usecases other than Btw |
Apologies I thought I included information on this in the original issue. The problem is on this line for parsing out the environment variable. The split on the semicolon does not account for the possibility of the semicolon being inside quotes. For example, if I take the C API example from the getting started page and add
right after the
|
I think you're probably right that |
But for the case of [tool.scikit-build.cmake.define]
SOME_DEFINE = {env="SOME_DEFINE", default="EMPTY"} But I think what you really want there is to parse the quotation marks in Footnotes |
Before @henryiii updated #727 to use shlex (which was a great solution in that case) I was using a regex to capture this. In this instance maybe that's the only way forward? Regular expressions do seem like the right tool in this case; I am skeptical that any parsing engine we tried to build would be any more foolproof or less complicated. |
What about deprecating the Do you have a regex101 link of the regex you think of using to test some edge cases? |
How about something like this?
|
I'm not sure what syntax you're suggesting to deprecate since the core syntax is CMake's and not SKBC's. |
The deprecation would be in your example the |
Since I just opened and closed #944, let me add to this:
I guess a better solution would be in the style of #944 where parsing is avoided by passing Can I instead have |
This is essentially the converse of #727. The logic for splitting up items in
SKBUILD_CMAKE_ARGS
does not account for the possibility of entries that are themselves semicolon-separated lists. ConsiderThe text was updated successfully, but these errors were encountered: