Skip to content
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

CMake: fail for unsupported platforms #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

CMake: fail for unsupported platforms #54

wants to merge 2 commits into from

Conversation

axel-h
Copy link
Member

@axel-h axel-h commented Jan 24, 2024

Fail for unsupported platforms instead of doing something with potentially undefined or empty variables results in strange errors later that are a hard to understand.

@chrisguikema
Copy link
Contributor

Does this not already happen in settings.cmake?

set(supported "tk1;tx1;tx2;exynos5422;qemu-arm-virt;odroidc2;zcu102")
if(NOT "${PLATFORM}" IN_LIST supported)
    message(FATAL_ERROR "PLATFORM: ${PLATFORM} not supported.
         Supported: ${supported}")
endif()

@axel-h
Copy link
Member Author

axel-h commented Jan 24, 2024

True. But the check there and the setup here are two different places, so having the "else" here helps finding the places where new platforms must add code.

@axel-h axel-h force-pushed the patch-axel-9 branch 4 times, most recently from 6b00a76 to 6d8d123 Compare January 25, 2024 14:30
@axel-h
Copy link
Member Author

axel-h commented Jan 25, 2024

But you have a point, we should have explicit checkes in settings.cmake also. Actually, moving all this to platform specific folder would be nicer, but that's a future step

@chrisguikema
Copy link
Contributor

I agree about having settings and specific features imported from platform specific folders. That is so much nicer than having a load of if/else statements.

@axel-h axel-h force-pushed the patch-axel-9 branch 5 times, most recently from 797190a to 999c0bf Compare January 30, 2024 11:34
@axel-h axel-h added hw-build hardware builds for this PR and removed hw-build hardware builds for this PR labels Jan 30, 2024
@axel-h axel-h added the hw-test hardware builds + runs for this PR label Jan 31, 2024
Copy link
Contributor

@chrisguikema chrisguikema left a comment

Choose a reason for hiding this comment

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

I don't have a problem with merging this. Its definitely better to have settings/configuration options for each platform specifically called out, instead of running on assumptions.

Copy link
Member

@lsf37 lsf37 left a comment

Choose a reason for hiding this comment

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

That looks good to me.

A somewhat related point (but not for action for this PR) is that it is easy to be confused between vm_minmal for Arm and minimal/minimal_64 for x86. In particular, when you try to provide something like x86 or pc99 to the vm_minimal app, you will be told that it's not supported and may well give up instead of ever finding the minimal app. We should probably give a hint for this in the error message there (and for Arm in the minimal apps).

Axel Heider added 2 commits March 16, 2024 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hw-test hardware builds + runs for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants