-
Notifications
You must be signed in to change notification settings - Fork 277
Native CMake support in VisualStudio #5162
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
Conversation
Oh actually, question: since at the moment we require VS 2015+, does this degrade the experience on VS2015 or 2017? |
@smowton, nope, you still can configure cmake the old way (and with less dependencies). This is just adding cmake native as an option (which is available even in 2017). The only downside is you need to have git. |
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.
The CMake changes look OK to me - might also be worth @hannes-steffenhagen-diffblue taking a look at those too. One thing I am a bit concerned about is that, if I'm reading this PR correctly, you've switched the CI builds from Makefile based builds to CMake based builds, yes? We have end users that depend on Windows Makefile based builds, so I would like to see those builds still exercised in CI somewhere so that they don't bit rot... Unless @peterschrammel is happy for CI to change if he thinks the users I have in mind might be willing to change their build system?
@chrisr-diffblue Fair enough, I'm not particularly attached to CI changes. I just wanted to try to see them work on CI. Removed. |
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.
Thanks @LAJW - the other option would be to liaise with Peter S about potentially adding a second Windows CI build, so that both the CMake and Make based builds get exercised in CI.
Oh, and one other thought (sorry! :-) ) - I believe the Windows Makefile builds use CLCACHE - do the CMake based builds do the same? |
@chrisr-diffblue That was the intent in the CI changes. We're gonna have to make it work for test-gen too, so it'll come around. Outside of that you can use whichever generator you want. |
Suppresses a "missing project" warning. Each CBMC project should have a project tag.
This way you don't have to use Cygwin on Windows to configure cbmc with CMake and allows you to use Windows's native CMake support (assuming git is installed).
It's probably safe to assume (since the project relies on submodules) that the user has git installed, so this will stop configuration rather than display a warning and then stop with a confusing error.
Codecov Report
@@ Coverage Diff @@
## develop #5162 +/- ##
===========================================
- Coverage 67.25% 67.19% -0.07%
===========================================
Files 1155 1149 -6
Lines 94461 94247 -214
===========================================
- Hits 63534 63328 -206
+ Misses 30927 30919 -8
Continue to review full report at Codecov.
|
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 PR failed Diffblue compatibility checks (cbmc commit: ecce25f).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132017019
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
Edit: fixup - I misunderstood how/where ansi_c_library_sources file was created |
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 PR failed Diffblue compatibility checks (cbmc commit: 676cb0b).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132178299
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 7707605).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132184613
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 85d15a5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132325446
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 069c761).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132328171
@peterschrammel windows/cmake codebuild added (with ninja and clcache)! |
@kroening, @tautschnig, this is ready to go. |
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 PR failed Diffblue compatibility checks (cbmc commit: 1cf0056).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132386896
Status will be re-evaluated on next push.
Common spurious failures include: the cbmc commit has disappeared in the mean time (e.g. in a force-push); the author is not in the list of contributors (e.g. first-time contributors); compatibility was already broken by an earlier merge.
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 519a802).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/132408233
These changes let you compile and run this project using VisualStudio's native CMake support.
To achieve this, I dropped the dependency on Cygwin, and only require git bash (which you're bound to have if you're using git) and the chocolatey
winflexbison3
package (chocolatey is already used/preinstalled on CI).Tested on VS2019 community edition, developer experience is much better than manually generating projects with CMake - it uses Ninja by default, which uses multi core compilation, unlike manually generated CMake projects.
Setup on VS with this PR boils down to two steps:
choco install winflexbison3
File -> Open -> CMake -> CBMC
Each commit message has a non-empty body, explaining why the change was made.
[n/a] Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
[n/a] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
[n/a] Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
[n/a] My commit message includes data points confirming performance improvements (if claimed).
My PR is restricted to a single feature or bugfix.
White-space or formatting changes outside the feature-related changed lines are in commits of their own.