Closed mjbogusz closed 3 years ago
Can you try out the mbed-pathless
branch? I integrated a change which adds a -x
option to configure_for_target.py. You should be able to pass the directory containing custom_targets.json to that option and it should load.
This has now been merged into master.
Finally I've got the time to test this out and while the configure_for_target.py
script recognizes the custom_targets.json
file now, it completely ignores my TARGET_MY_CUSTOM_TARGET
directory whatsoever.
This means that my target's source files don't get added to the MbedOSConfig-TARGET.cmake
file. The only workaround I've managed to make work is quite a roundabout one:
INTERFACE
library) for each boardtarget_include_directories
for the cmake-os-static
target (this will get complicated quickly if targeting multiple boards)system_clock.c
) to .mbedignore
(And if one custom target overwrites a file, all others have to do it too)If there is a better way to do it, please let me know. In the meantime, I'm trying to figure out how to modify the configure_for_target
script to utilize the custom target's directory.
Oh you know, I just ran into the same thing a few weeks ago, and ended up with a hacky CMake fix similar to what you did. Your PR seems like a way better solution.
Hi, first, thanks for the great project - not having to hack away on the mbed-generated cmake files is a blessing!
However, one thing that I didn't manage to get working properly is custom targets - the wiki only mentions this:
I've tried declaring the target by creating the
custom_target.json
file and theTARGET_MY_CUSTOM_TARGET
directory as I did for the mbed-cli, but it wasn't picked up regardless of the placement of these files.The only way I was able to get my custom target to get recognized by the
configure_for_target.py
script was to place the target's directory in thembed-src/targets
tree and add it in the maintargets.json
file. This is not ideal as I can't simply add these changes to a VCS. My workaround was usinggit diff --patch
andgit apply
wrapped in a script and keeping the resulting patch in my VCS, but this has the downside of having to run the scripts on EVERY new environment (as it includes thePinNames.c
,PeripheralNames.h
and so on), not only for reconfiguration.Is there something I've missed? A specific combination of
custom_target.json
andTARGET_MY_CUSTOM_TARGET
placement? An argument to theconfigure_for_target.py
script?