Clarify that NativeLibrary can be used for transitive dependencies#42815
Open
sweemer wants to merge 1 commit intodotnet:mainfrom
Open
Clarify that NativeLibrary can be used for transitive dependencies#42815sweemer wants to merge 1 commit intodotnet:mainfrom
sweemer wants to merge 1 commit intodotnet:mainfrom
Conversation
Member
|
Also @MichalStrehovsky |
Comment on lines
+59
to
+63
| <NativeLibrary Include="Dependency.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" /> | ||
| <NativeLibrary Include="Dependency.a" Condition="!$(RuntimeIdentifier.StartsWith('win'))" /> | ||
| <NativeLibrary Include="/path/to/Dependency.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" /> | ||
| <NativeLibrary Include="/path/to/Dependency.a" Condition="!$(RuntimeIdentifier.StartsWith('win'))" /> | ||
| <!-- Specify an additional library to link against, if necessary --> | ||
| <NativeLibrary Include="/path/to/TransitiveDependency.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" /> | ||
| <NativeLibrary Include="/path/to/TransitiveDependency.a" Condition="!$(RuntimeIdentifier.StartsWith('win'))" /> |
Member
There was a problem hiding this comment.
I would leave this section as is and add a note/remarks after. Something to the tune of:
- If the native library has a dependency on other static libraries, the transitive dependencies need to be provided as
NativeLibraryitems as well. Native linker will fail with a message with missing symbols if the transitive dependencies are not provided. - Platform conventions are followed when it comes to the format of
NativeLibraryentries. The underlying native linker may search standard library paths or allow rooted file paths.
Author
There was a problem hiding this comment.
Thanks for the review. Should I make the requested changes, or would it be better for someone from Microsoft to provide the correct wording?
Contributor
There was a problem hiding this comment.
@sweemer You can make the suggested changes. Thank you.
Author
There was a problem hiding this comment.
Done! I have lightly edited @MichalStrehovsky 's points, but please feel free to modify the wording if necessary.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I have added the following two clarifications:
NativeLibrarycan be used more than once. Originally I thought that it can only be used for the library specified inDirectPInvoke, but after some time I realized it can be used for transitive dependencies as well. My change makes this more clear./path/toto make it clear that paths are accepted and that the file does not need to be manually moved to the project output directory in order to be found.Internal previews