Skip to content

cmake: Fix added sources to targets - #3897

Merged
ronald-cron-arm merged 1 commit into
Mbed-TLS:developmentfrom
d3zd3z:fix-cmake28
Jan 26, 2021
Merged

ronald-cron-arm merged 1 commit into
Mbed-TLS:developmentfrom
d3zd3z:fix-cmake28

Conversation

@d3zd3z

@d3zd3z d3zd3z commented Nov 18, 2020

Copy link
Copy Markdown
Contributor

In cmake version < 3.0, the SOURCES property on targets cannot be
modified after the target is defined. There are several instances in
the code that were using target_properties(), which is not available
in the older versions of cmake. Unfortunately, the workaround in #3801
(381c107) assumes that this SOURCES property can be modified.

Work around this by building up any necessary sources before declaring
the target. This is more awkward, but needed to continue to be able to
support the old versions of cmake.

Fixes #3788

Signed-off-by: David Brown david.brown@linaro.org

Status

READY

Requires Backporting

Yes, but I don't think it applies.

Migrations

NO

Todos

  • Tests
  • Documentation
  • Changelog updated
  • Backported

Steps to test or reproduce

Outline the steps to test or reproduce the PR here.

$ mkdir build
$ cd build
$ cmake-2.18.12.2 ..
$ make

In cmake version < 3.0, the SOURCES property on targets cannot be
modified after the target is defined.  There are several instances in
the code that were using `target_properties()`, which is not available
in the older versions of cmake.  Unfortunately, the workaround in Mbed-TLS#3801
(381c107) assumes that this SOURCES property can be modified.

Work around this by building up any necessary sources before declaring
the target.  This is more awkward, but needed to continue to be able to
support the old versions of cmake.

Fixes Mbed-TLS#3788.

Signed-off-by: David Brown <david.brown@linaro.org>
@mpg mpg added bug component-platform Portability layer and build scripts needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review labels Nov 19, 2020
@d3zd3z

d3zd3z commented Dec 4, 2020

Copy link
Copy Markdown
Contributor Author

Can someone from Arm paste in the relevant errors from the CI builds? Thanks.

@gilles-peskine-arm

Copy link
Copy Markdown
Contributor

pr-merge passed on a8e309e but didn't report to GitHub. pr-head only failed due to a network glitch, and pr-merge passed so it doesn't matter.

@mpg mpg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

@mpg mpg removed the needs-reviewer This PR needs someone to pick it up for review label Dec 8, 2020
@mpg

mpg commented Dec 11, 2020

Copy link
Copy Markdown
Contributor

@d3zd3z The CI fully passed, but the pr-merge job just failed to report to github.

@paul-elliott-arm paul-elliott-arm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@ronald-cron-arm ronald-cron-arm removed the needs-review Every commit must be reviewed by at least two team members, label Jan 26, 2021
@ronald-cron-arm
ronald-cron-arm merged commit ddb3bd5 into Mbed-TLS:development Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug component-platform Portability layer and build scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cmake 2.8.12 does not work with mbedtls 2.24, cmake command "target_sources" renamed in cmake 2.8.12

5 participants