Skip to content

Commit

Permalink
Kconfig: don't fall back on CONFIG_TIGERLAKE
Browse files Browse the repository at this point in the history
There's really no reason to fall back on a default "platform" and pick
up a bunch of other, totally random settings.

Now the following command fails immediately with a useful `platform not
defined` error message instead of stopping with a cryptic
`platform/trace/trace.h: No such file or directory` after successfully
compiling half the .c files in a Frankenstein CONFIG_uration.

```
  west build -p --board mimx8mm_evk_a53 modules/audio/sof/app
```

More context in #7192.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb committed Jun 8, 2023
1 parent 71f5fa7 commit 13ae274
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ elseif(CONFIG_MT8188)
set(platform_folder mt8188)
elseif(CONFIG_MT8195)
set(platform_folder mt8195)
else()
message(FATAL_ERROR "Platform not defined, check your Kconfiguration?")
endif()

set(fw_name ${CONFIG_RIMAGE_SIGNING_SCHEMA})
Expand Down
4 changes: 3 additions & 1 deletion src/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ menu "Platform"
choice
prompt "Platform"
default ZEPHYR_POSIX if ARCH_POSIX
default TIGERLAKE
# It's not really 'optional' but no value is much less confusing
# than falling back on a totally random value.
optional

config TIGERLAKE
bool "Build for Tigerlake"
Expand Down
3 changes: 3 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ zephyr_library_sources_ifdef(CONFIG_LIBRARY
${SOF_DRIVERS_PATH}/host/ipc.c
)

if(NOT DEFINED PLATFORM)
message(FATAL_ERROR "PLATFORM is not defined, check your Kconfiguration?")
endif()
zephyr_include_directories(${SOF_PLATFORM_PATH}/${PLATFORM}/include)

# Mandatory Files used on all platforms.
Expand Down

0 comments on commit 13ae274

Please sign in to comment.