ARMmbed / mbed-tools

⚠️ Beta Status: New command line tooling for Mbed OS
Apache License 2.0
45 stars 30 forks source link

TARGET_NAME global macro is not set #313

Closed jeromecoutant closed 3 years ago

jeromecoutant commented 3 years ago

Describe the bug

With CLI1, TARGET_NAME is set to the target name

CLI2 doesn't set it

To Reproduce

See error console print: https://github.com/ARMmbed/mbed-os/blob/master/platform/source/mbed_error.c#L557-L558

Expected behavior

Screenshots

Desktop (please complete the following information):

Mbed (please complete the following information):

Additional context

LDong-Arm commented 3 years ago

@jeromecoutant Good catch.

I had a quick look, CLI 2 defines -DTARGET_xxx, but it's only useful if one expects a given target and wants to check if it is the current target. To get a target name without knowing, yes we miss a macro. It should be super quick to fix in CMake so I'll raise a PR later.

LDong-Arm commented 3 years ago

https://github.com/ARMmbed/mbed-os/pull/15041 created