Skip to content

Commit aca2d63

Browse files
committed
CMake: Set TARGET_NAME macro
The C/C++ macro `TARGET_NAME` allows code to print the current target's name, e.g. in error reporting when a fault happens. This macro is exported by Mbed CLI 1 and used by mbed_error.c, so for compatibility we let CMake set the same name of macro. Fixes ARMmbed/mbed-tools#313
1 parent be31d50 commit aca2d63

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ if(${CMAKE_CROSSCOMPILING})
101101

102102
target_compile_definitions(mbed-core
103103
INTERFACE
104+
TARGET_NAME=${MBED_TARGET}
104105
${MBED_TARGET_DEFINITIONS}
105106
${MBED_CONFIG_DEFINITIONS}
106107
)

0 commit comments

Comments
 (0)