-
Notifications
You must be signed in to change notification settings - Fork 125
Embed nrnunits.lib #3471
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
base: master
Are you sure you want to change the base?
Embed nrnunits.lib #3471
Conversation
✔️ 496a655 -> artifacts URL |
|
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 was renamed because we use cpp_cc_build_time_copy
on some of the directories, so nrnunits.lib
was first set-up at configure time, but then cpp_cc_build_time_copy
would clobber it at build-time, so to work around it, we just rename it.
✔️ 290387a -> artifacts URL |
✔️ 290387a -> Azure artifacts URL |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3471 +/- ##
=======================================
Coverage 68.40% 68.40%
=======================================
Files 682 682
Lines 116565 116574 +9
=======================================
+ Hits 79731 79747 +16
+ Misses 36834 36827 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 solves a definite problem. There is a possibility of user confusion about where units are coming from, but that can be disambigutated if they use a MODLUNIT environment variable.
configure_file(${PROJECT_SOURCE_DIR}/share/lib/nrnunits.lib.in | ||
${PROJECT_BINARY_DIR}/share/nrn/lib/nrnunits.lib @ONLY) | ||
|
||
set(nrnunits_start "R\"qwerty(") |
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.
Optional...Could use a comment. Took me a while (and looking at the constructed embedded_nrnunit.lib file) to realize the reason for the start/stop idiom. I'd never seen this C++ feature before
Fix #3470.
We now configure both
nrnunits.lib
andembedded_nrnunits.lib
, and embed the latter directly as astring_view
inunits.cpp
.This is only used as a last resort (i.e. if all other methods of figuring out the path to a
nrnunits.lib
file fail).The alternative would be to figure out the path of the binary executable at run-time, which would require too much platform-specific code.