-
-
Notifications
You must be signed in to change notification settings - Fork 37
Feature/presets enchancements #19
base: main
Are you sure you want to change the base?
Feature/presets enchancements #19
Conversation
Codecov Report
@@ Coverage Diff @@
## main #19 +/- ##
=======================================
Coverage 77.77% 77.77%
=======================================
Files 3 3
Lines 36 36
Branches 19 19
=======================================
Hits 28 28
Misses 7 7
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@ddalcino on gcc Debug build the CI failed to install cmake is anything wrong? |
@lefticus there are still some pending questions about the user/developer mode. And the combinatorial complexity of all the supported platforms, toolchains etc. Also, it was proposed by @ClausKlein to also support |
4bb8363
to
1ea2289
Compare
That looks like an issue with setup-cpp. Looks like it resolved itself though. If you're worried about it, you could file an issue. It's reasonable to expect that |
We are deliberately not supporting mingw due to a long history of really nasty bugs. I thought we had discussed this somewhere else in the IMHO, we can only claim to support the platforms that we are testing in CI. We should try not to go out of our way to break the project on BSD, but I don't think we need to go out of our way to support it. If you support BSD, where do you draw the line? Solaris? ReactOS? FreeDOS? Redox? Serenity? There's just too many. Please don't forget about our Conan dependencies, many of which do not support any OSes other than win/mac/linux. Let's not forget, the cmake presets are a convenience. Users can easily do without them, or write their own. |
@Jason5480 Hi Nikloas, we should have a separate forum to have such a diskusion. If you want to use the presets in an If you do not know, were the And with the Now I see why the presets are from microsoft |
Currently VSCode and VisualStudio support all three types of presets. CLion supports only build presets QtCreators integration is on its roadmap. For XCode I do not know but the key concept of the presets is that in the future you can have IDE agnostic codebases no need to support *.vsxpjoj files along with *.creator and other IDE specific files. You have one format to produce reproducible builds in all of them! And the command line options should not be excluded from this for development. |
Command line options override the presets so you can pass your own binary and install dir through the cli. I just put the VSCode/VS defaults there in case you want to open the project that is already build before with another IDE it should be able to find existing build folder and not re-build all of them on its own (different) default folder |
In my world, I generate a build project (MVS, Xcode, Ninja Multi-Config, Eclipse, ...) from console with CMake. If needed, I open the generated IDE to So I never need an In every IDE I ever used, the CMake generated targets see https://discourse.cmake.org/t/cmake-presets-what-is-a-testpreset-for/5404 |
Yes, this is the "old" way (better than the manual) of supporting several IDEs. With the presets the IDEs are getting closer to the CMake and not the other way around. Also, vendor specific options enable some customization points for the IDE without affecting others. Having different generators for each IDE is also an option but how do you make sure that project for Eclipse and VS have been generated/configured with the same cmake variables and have the same behavior? Well, you can inspect the cmake variables but when using presets the author makes sure that the correct variables are passed. |
I love presets, at least the |
Well I agree that it is way simpler to just pass |
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.
This is looking pretty good so far. I, like you, am a little disappointed that this couldn’t be shorter, but I don’t see a reasonable way to make that happen (other that generating this file with a script, and I’m not convinced we want that).
The only thing that this PR is really lacking is automated testing. I think it would be reasonable to add a separate build step to the .github/workflows/ci.yml file that runs cmake configure, build, and test using the appropriate presets. I don’t think anybody wants to test the presets manually on 3 different OSs over and over again. An automated CLI test should give us a really good idea of whether or not the tests will work on VS Code on a given platform.
With automated tests, I think this is an easy approval from me.
Nice idea to add those presets to the CI I will try it! |
9fe24db
to
26bcdf0
Compare
Squashed commit: [c64694d] Rename the linux presets to unixlike [0a57a97] Add binaryDir and installDir to be used in case of cli [ad5a3e7] Move mode options to CMakeUserPresets.json file [1c0fa00] Make hidden preset for each supported compiler/toolchain and reuse them in not hidden presets using "inherits" list. This way we the future changes will be applied only to the preset that is responsible for that functionality. [607a69f] Set "Ninja Multi-Config" generator as the default. Add buildPresets for Debug and Release. Modify testPresets accordingly [a98c295] Create separate developer and user mode hidden presets and use inherits to compose them to the non-hidden presets [e26f74c] replace conf- with config- in preset names [802e988] Let the IDE to set the default binary and install directories
…so to prevent clutter (+1 squashed commits) Squashed commits: [7f3630d] Keep it simple remove unecessary 'build-` and 'test-` prefixes to make life easier as @KlausKlein suggested here cpp-best-practices#31 (comment)
Keep some naming conventions consistent (+1 squashed commits) Squashed commits: [8252d13] Update documentation Keep some naming conventions consistent
e12ce1f
to
7d1d29f
Compare
It's been a long time since we discussed this but I was not able to pass the presets in the ci.yml and action.yml. The problem here is that the compiler, generator, build_type, and developer_mode settings are defined in the ci where this info should be read from the CMakePresets.json file instead if we want to support CMake 3.16. Maybe @aminya or @lefticus can help with that. Otherwise, I will revert the yml changes and I will open another issue for the CI part. |
|
This PR contains several enhancement to the Cmake presets.
Currently we support 4 toolchains +1 mode option for msvc (thus 5 non-hidden configure presets) and the corresponding Debug and Release builds (thus 10 non-hidden buildPresets and 10 testPresets)
Since this is getting bigger and bigger with each new configuration option added to the project the configurePresets are doubled in numbers (e.g. msvc + mode option -> msvc Developer Mode and msvc User Mode) and the buildPresets and testPresets are quadrupled.
So, at this point I have the following questions.
@ddalcino @aminya @lefticus @oskidan some feedback would be welcome!
Also, @oskidan and @ddalcino can you check that those changes are still functional in macOS to make sure I didn't mess with #16
Co-Author: @ClausKlein Thank you for the feedback and your test in macOS that unfortunately cannot do.