-
Notifications
You must be signed in to change notification settings - Fork 680
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
build(cmake): fix configure_file version header #1131
Conversation
c33a475
to
7f4f03a
Compare
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #1131 +/- ##
==========================================
+ Coverage 78.48% 78.64% +0.15%
==========================================
Files 53 53
Lines 6892 6892
==========================================
+ Hits 5409 5420 +11
+ Misses 1483 1472 -11 ☔ View full report in Codecov by Sentry. |
Thanks @shlomnissan. Your PR looks mostly fine to me, but I have two comments. (1) I am curious why (2) Does the same issue you are trying to address also affect the Meson build environment? @Tachi107, any feedback? |
Hi @shlomnissan, thanks for your patch. I believe that the current behaviour is the intended one, i.e. the generated file should reside in the a build directory that gets added to the include list by CMake or Meson. Why do you think that the version file should be generated in the source directory? |
I actually didn't realize that he was trying to output it into the source directory. But yes, @Tachi107 is correct. That's how build environments normally are suppose to work. Since the source directory in some situations might be read only, that's the only way to allow remote builds. |
Interesting... I didn't know that the compiler driver includes the build folder in its header search paths. Suppose I want to use the version variables defined in |
The |
@kiplingw Thank you for the feedback, and I apologize for the delayed response. I’m going to close the PR. However, I am still uncertain about how to use |
Hey @shlomnissan, I strongly recommend not including the project source within your project. If you want to make source level changes, then by all means do that. But my guess is you probably just want to use the library. If the latter, at configure / build time you want to use As for using
Hopefully that's helpful. |
A relative path for
configure_file
<output>
is treated with respect to the value ofCMAKE_CURRENT_BINARY_DIR
. This PR adds an absolute path to the output parameter soversion.h
is generated and stored in the include directory.