mbed-ce / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
37 stars 12 forks source link

Bugfix: Only link mbed-wifi if it exists for this target #252

Closed multiplemonomials closed 4 months ago

multiplemonomials commented 4 months ago

Summary of changes

This fixes a build error that was happening after #247 for targets that did not have any wifi drivers when you linked mbed-netsocket. The issue is that if you pass a non-existant library to a target_link_libraries() call, CMake thinks it's a system library and tries to link it with -l (legacy behavior), causing a linker error rather than a CMake error as it should. Thanks to @JojoS62 for diagnosing the issue!

Impact of changes

mbed-netsocket should be usable again... oops

Migration actions required

Documentation

None

Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[X] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Ideally this should be covered by one of the new CI builds once they're added...


Reviewers


JojoS62 commented 4 months ago

thanks for the quick response, the fix works for non wifi target, I cannot test wifi targets yet.