[msbuild/dotnet] Add support for NativeReference items. Fixes #11061.#11593
[msbuild/dotnet] Add support for NativeReference items. Fixes #11061.#11593rolfbjarne merged 9 commits intodotnet:mainfrom
Conversation
…ble from elsewhere. Also rename it to LinkerOptions, and move the BuildNativeReferenceFlags method into the class as well.
…11061. * Pass any native references to the LinkNativeCode task so that they're linked with the main executable. * Copy frameworks and dynamic libraries to the app bundle (also add support for MSBuild metadata - the CopyToAppBundle property - to avoid copying a framework / dynamic library to the app bundle). * Add tests. Fixes dotnet#11061.
If there's a dynamic library in the -L path in addition to the static library, then the native linker will link with the dynamic library instead, which is not what we want. Instead just pass the full path to the static library to the linker.
| $(DOTNET6) build macOS/*.csproj /bl | ||
|
|
||
| run-mac: | ||
| /Users/rolf/work/maccore/whatever/xamarin-macios/tests/dotnet/NativeReferencesApp/macOS/bin/Debug/net6.0-macos/osx-x64/NativeReferences.app/Contents/MacOS/NativeReferences |
There was a problem hiding this comment.
should be relative to $(TOP)
your's too far away, well beyond MAX_PATH ;-)
There was a problem hiding this comment.
your's too far away, well beyond
MAX_PATH;-)
🤦
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) Test results1 tests failed, 106 tests passed.Failed tests
Pipeline on Agent XAMBOT-1100.BigSur' |
spouliot
left a comment
There was a problem hiding this comment.
This seems to cover xcframework but there's no associated tests ported (or added) to dotnet
| $(DOTNET6) build macOS/*.csproj /bl | ||
|
|
||
| run-mac: | ||
| /Users/rolf/work/maccore/whatever/xamarin-macios/tests/dotnet/NativeReferencesApp/macOS/bin/Debug/net6.0-macos/osx-x64/NativeReferences.app/Contents/MacOS/NativeReferences |
I've added a test case for xcframeworks as well (and as expected, it wasn't working at first, I had to fix something). |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffTest results33 tests failed, 75 tests passed.Failed tests
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) Test results1 tests failed, 107 tests passed.Failed tests
Pipeline on Agent XAMBOT-1104.BigSur' |
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) Test results1 tests failed, 107 tests passed.Failed tests
Pipeline on Agent XAMBOT-1101.BigSur' |
|
Test failure is unrelated (https://github.com/xamarin/maccore/issues/2414). |
with the main executable.
for MSBuild metadata - the CopyToAppBundle property - to avoid copying a
framework / dynamic library to the app bundle).
LinkNativeCode task.
Fixes #11061.