-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[mono][wasm] Include NativeLibrary items to the NativeFileReference items #101532
Conversation
{ | ||
string projectName = $"AppUsingNativeLibrary-a"; | ||
buildArgs = buildArgs with { ProjectName = projectName }; | ||
buildArgs = ExpandBuildArgs(buildArgs, extraItems: "<NativeLibrary Include=\"native-lib.o\" />"); |
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.
buildArgs = ExpandBuildArgs(buildArgs, extraItems: "<NativeLibrary Include=\"native-lib.o\" />"); | |
buildArgs = ExpandBuildArgs(buildArgs, extraItems: "<NativeLibrary Include=\"native-lib.o\" />\n<NativeLibrary Include=\"DoesNotExist.o\" \>"); |
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 will fail the build, right? It would be ideal to have it conditional as theory data
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.
We need to make it not fail the build since NativeLibrary does not mind if the file doesn't exist
{ | ||
string projectName = $"AppUsingNativeLibrary-a"; | ||
buildArgs = buildArgs with { ProjectName = projectName }; | ||
buildArgs = ExpandBuildArgs(buildArgs, extraItems: "<NativeLibrary Include=\"native-lib.o\" />"); |
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 will fail the build, right? It would be ideal to have it conditional as theory data
@@ -249,6 +249,7 @@ | |||
</PropertyGroup> | |||
|
|||
<ItemGroup> | |||
<NativeFileReference Include="@(NativeLibrary->'%(Identity)')" Condition="'@(NativeLibrary->Count())' != '0'" /> |
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.
<NativeFileReference Include="@(NativeLibrary->'%(Identity)')" Condition="'@(NativeLibrary->Count())' != '0'" /> | |
<_ExistingNativeLibrary Include="@(NativeLibrary->Exists())" /> | |
<NativeFileReference Include="@(_ExistingNativeLibrary->'%(Identity)')" /> |
We need something that does effectively this (or a cleaner expression of 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.
Would it make sense to move the condition and items copying into some target executed just before we need these items? So that the lib can be created or copied by some user's target?
EDIT: Hmm. That would a change in evaluation if we need native build
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.
Moved under _InitializeCommonProperties
<Target Name="_InitializeCommonProperties"> |
With this it works when NativeLibrary
is added under user's target.
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 the sake of compatibility we should probably ignore missing NativeLibrary entries.
…tems (dotnet#101532) * Include NativeLibary and add test case * Move to common place * Ignore missing NativeLibraries * Move items copying into target
…tems (dotnet#101532) * Include NativeLibary and add test case * Move to common place * Ignore missing NativeLibraries * Move items copying into target
…tems (dotnet#101532) * Include NativeLibary and add test case * Move to common place * Ignore missing NativeLibraries * Move items copying into target
Fixes #96864