-
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
[Feature] CMake Variants from the CMake Tools for Visual Studio Code. #2
Conversation
Thanks, @toolcreator. It's really a nice feature. Things I think can be discussed:
|
Or support both. And I just check your parser for yaml. I think it's ok, we can make it robust anyway. |
Thanks for the feedback! Notable changes
On the input formatI think we should definitely support YAML, because the documentation for the variants makes heavy use of it. The VSCode extension also supports JSON as an input format, and my implementation should do so as well via TODO
|
Yeah, I didn't find any lightweight YAML parsing library either. But I recently write a tiny JSON parser in C++. I think it's not that hard to swicth it to character-based parsing. I will try to make one when I have time. |
And I think we should also support lua format. |
How would we go about with that? Read it from a file as well? Or do you have someting else in mind? |
Yes, I think it is okay to read it from a file, just like JSON and YAML format. It's natural to me. |
Adds support for CMake Variants from the CMake Tools for Visual Studio Code.
Adds support for CMake Variants from the CMake Tools for Visual Studio Code.
Adds support for CMake Variants from the CMake Tools for Visual Studio Code.
It's far from perfect though currently (I'm a Lua beginner and didn't write any comments (yet)).
The YAML parsing is done by simpleyaml which I wrote specifically for this purpose.
At first I couldn't find any simple, dependency-free YAML parsing library. Then I found there are some options on github, but I was already done with my own implementation.
It does only parse well-formed files, probably only parses a subset of YAML, and doesn't have any error handling, so maybe it should be exchanged for something more robust.
A thing I added for this to work more fluently is, that CMakeSelectBuildType deletes the build directory if the chosen build type changes. This way it's quicker to change between build types.
variants.lua contains some CC-BY-SA licensed code from rosettacode.org, but that's compatible with GPLv3.
I'm dropping this here as an idea. If you're interested in integrating the feature we could discuss if we should change anything before merging.
Otherwise I may just keep it as is for my own use.