-
Notifications
You must be signed in to change notification settings - Fork 284
Fix CPP models when using CMake Build #5285
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
4cbefcb to
29a481a
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5285 +/- ##
===========================================
+ Coverage 67.51% 67.95% +0.43%
===========================================
Files 1170 1170
Lines 96338 96338
===========================================
+ Hits 65044 65464 +420
+ Misses 31294 30874 -420
Continue to review full report at Codecov.
|
|
This PR shouldn't pass:
The reason is the cmake file for the cpp folder does not add the dependency so the The CI isn't failing:
Therefore we have no CI for CMake builds 😭 |
b294b47 to
c8cdb19
Compare
|
Rebased on top of #5287 to ensure the cbmc-linux-cmake-gcc job now fails. |
|
Confirmed both the cpp-new test (no model for __new) and the string-abstraction tests are failing as expected on CMake job. And indeed CI fails 🎉 |
when linking the cprover library. The default mode for this constructor of stringstream is to over-write the string used in construction, which presumably was not the intention here. Note: until now there wasn't anything too interesting in the prologue except for the string-abstraction define, which was ignored. But we might want more defines in the future.
Currently the CPP library is not built in cmake builds
This checks the body of goto functions whose implementation depends on whether the string abstraction macro is defined.
This ensures that the library is actually built (and therefore used) by the C++ frontend (otherwise, the CMake version never genreates cprover_library.inc and the C version of the file is imported twice. Also mirrored the changes made in the ansi-c CMakeLists.txt which detects changes in the source of the library
|
Now added commit that should fix the tests for the CMake build |
|
Write -> append? Seen it already, LGTM |
|
Also looks sane except nitpick above |
|
@smowton in this case though |
|
Doh right, sorry |
| ${sources} | ||
| PROPERTIES | ||
| OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cprover_library.inc" | ||
| ) |
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 should just be add_dependencies(cpp "${CMAKE_CURRENT_BINARY_DIR}/cprover_library.inc") I think?
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.
Copied from ansi-c, will try updating both.
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 doesn't work:
CMake Error at src/cpp/CMakeLists.txt:30 (add_dependencies):
The dependency target
"/home/tkiley/workspace/cbmc/build/debug/src/cpp/cprover_library.inc" of
target "cpp" does not exist.
You're more than welcome to raise a follow up PR making this nicer, but I'd rather just merge this as is, rather than spend more time on it, since it does fix the problem of the C++ library and macros in the C library not working on CMake.
In trying to track down why the defines don't work in the library, I discovered that the cpp models (that includes definitions for new) do not work on CMake builds. I'm working on a fix, but just to confirm my suspicion I've added a test that I believe will pass on non-cmake builds but will fail on cmake builds.