Skip to content

Add support for custom_targets.json #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rwalton-arm
Copy link
Contributor

@rwalton-arm rwalton-arm commented Dec 22, 2020

Description

Adds support for custom_targets.json in the tools.

This is dependent on mbed-os CMake changes.
Without those changes adding a custom target using add_subdirectory will make mbed-os fail to build for standard mbed targets.

With those changes (once applied to all targets) you can add your target using add_subdirectory(<target-dir> EXCLUDE_FROM_ALL) before adding the mbed-os subdirectory, in the top level CMakeLists.txt, and the custom target will integrate into the build system without breaking it.

While I'm here fix the deploy --force option as that was broken.

Test Coverage

  • This change is covered by existing or additional automated tests.
  • Manual testing has been performed (and evidence provided) as automated testing was not feasible.
  • Additional tests are not required for this change (e.g. documentation update).

@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/custom-targets-json branch 2 times, most recently from b7e9cbd to 8f803c4 Compare December 22, 2020 09:36
@codecov
Copy link

codecov bot commented Dec 22, 2020

Codecov Report

Merging #160 (94d85af) into master (7b381a0) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #160      +/-   ##
==========================================
+ Coverage   96.54%   96.55%   +0.01%     
==========================================
  Files          94       94              
  Lines        2605     2615      +10     
==========================================
+ Hits         2515     2525      +10     
  Misses         90       90              
Impacted Files Coverage Δ
src/mbed_tools/build/_internal/cmake_file.py 100.00% <100.00%> (ø)
src/mbed_tools/build/_internal/write_files.py 100.00% <100.00%> (ø)
src/mbed_tools/build/config.py 100.00% <100.00%> (ø)
src/mbed_tools/cli/build.py 100.00% <100.00%> (ø)
src/mbed_tools/project/_internal/git_utils.py 100.00% <100.00%> (ø)
src/mbed_tools/project/_internal/project_data.py 97.26% <100.00%> (+0.15%) ⬆️
.../mbed_tools/targets/_internal/target_attributes.py 100.00% <100.00%> (ø)
src/mbed_tools/targets/get_target.py 100.00% <100.00%> (ø)

@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/custom-targets-json branch 2 times, most recently from 60af69f to 6c19600 Compare December 22, 2020 13:20
@rwalton-arm rwalton-arm linked an issue Jan 12, 2021 that may be closed by this pull request
2 tasks
@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/custom-targets-json branch 3 times, most recently from 3d4d11e to 30735ba Compare January 18, 2021 12:21
@rwalton-arm rwalton-arm marked this pull request as ready for review January 18, 2021 13:32
@rwalton-arm rwalton-arm marked this pull request as draft January 20, 2021 13:25
@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/custom-targets-json branch from 697a245 to 3f2f8b6 Compare January 27, 2021 14:40
@rwalton-arm rwalton-arm changed the title Dev/rwalton arm/custom targets json Adds support for custom_targets.json Jan 27, 2021
@rwalton-arm rwalton-arm changed the title Adds support for custom_targets.json Add support for custom_targets.json Jan 27, 2021
@urutva urutva force-pushed the dev/rwalton-arm/custom-targets-json branch 3 times, most recently from ac914f2 to bf10d32 Compare February 5, 2021 10:49
@@ -0,0 +1,18 @@
##
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this header match the format used in src/mbed_tools/project/_internal/templates/CMakeLists.tmpl (single #, no extra lines)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for providing a fix for this @Patater

Patater and others added 4 commits February 5, 2021 11:58
The default style for licenseheaders for CMake is to use ## and to have
some extra start and end comments around the license. Mbed style is to
use single # and no extra start and end comments. Add a settings file
for licenseheaders to override the default style with Mbed style.
The CMake function `mbed_set_mbed_target_linker_script` is deprecated in
Mbed OS. Remove it from `CMakeLists.tmpl`.
@urutva urutva force-pushed the dev/rwalton-arm/custom-targets-json branch from bf10d32 to 94d85af Compare February 5, 2021 14:43
Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Patater Patater marked this pull request as ready for review February 5, 2021 15:08
@Patater Patater merged commit 0f733ba into ARMmbed:master Feb 5, 2021
@boraozgen
Copy link

boraozgen commented Apr 8, 2021

Is there a guide for using this feature? I am getting fatal error: device.h: No such file or directory when compiling for my custom target. My target inherits MCU_STM32, therefore mbed-os\targets\TARGET_STM\device.h should be included, which apparently does not. It works with CLI1.

@boraozgen
Copy link

To answer my own question: The custom board porting guide has been updated to incorporate CLI 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mbed-tools doesn't parse custom_targets.json
4 participants