-
Notifications
You must be signed in to change notification settings - Fork 37
cmake: EXTERNAL_MPGEN cleanups #147
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,15 +61,15 @@ function(target_capnp_sources target include_prefix) | |
| ) | ||
|
|
||
| set(MPGEN_BINARY "") | ||
| if(EXTERNAL_MPGEN) | ||
| set(MPGEN_BINARY "${EXTERNAL_MPGEN}") | ||
| if(Libmultiprocess_EXTERNAL_MPGEN) | ||
| set(MPGEN_BINARY "${Libmultiprocess_EXTERNAL_MPGEN}") | ||
| if(NOT EXISTS "${MPGEN_BINARY}") | ||
| message(FATAL_ERROR "EXTERNAL_MPGEN: \"${MPGEN_BINARY}\" does not exist.") | ||
| message(FATAL_ERROR "Libmultiprocess_EXTERNAL_MPGEN: \"${MPGEN_BINARY}\" does not exist.") | ||
| endif() | ||
| elseif(TARGET Libmultiprocess::multiprocess) | ||
| set(MPGEN_BINARY $<TARGET_FILE:Libmultiprocess::mpgen>) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I attempted this a bunch of different ways, and with some approach this was necessary, but I forget why. I assume this is fine, thanks for simplifying. |
||
| set(MPGEN_BINARY Libmultiprocess::mpgen) | ||
| else() | ||
| message(FATAL_ERROR "No usable mpgen. Set EXTERNAL_MPGEN or enable the internal target.") | ||
| message(FATAL_ERROR "No usable mpgen. Set Libmultiprocess_EXTERNAL_MPGEN or enable the internal target.") | ||
| endif() | ||
|
|
||
| set(generated_headers "") | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Hmm, I purposefully avoided namespacing this because I was assuming that parent projects would always want to expose the same option and have it be automatically inherited here. Now they'll have to map it.
Not a big deal to me either way, I guess.
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.
For reference, code which sets this in depends is implemented in bitcoin/bitcoin@99b7b85 from bitcoin/bitcoin#31741 and seems to work reasonably well
Uh oh!
There was an error while loading. Please reload this page.
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.
For depends, sure, it doesn't matter. But when doing a non-depends cross-build, ccmake shows:
which is rather inconsistent and non-obvious to builders imo. Seems to me Capnp has it right. For a Core, I wouldn't expect to see that namespace.
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.
I see. This suggestion just came from #142 (comment), and I'm happy to rename this to something else or make a different change. Given the other names maybe
MPGEN_EXECUTABLEwould be a good name for this.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.
@hebasto might have more ideas too.
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.
Fwiw, I originally picked
EXTERNAL_CAPNPto mirror (what I thought was) the way Capnp handles it. But I see now that Capnp's is just a bool andCAPNP_EXECUTABLEis the actual path variable. So ACK toMPGEN_EXECUTABLEinstead if we go down this path.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.
So do I.