cmake: defconfigs support

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
Janusz Jankowski 2019-01-15 21:20:41 +01:00 committed by Liam Girdwood
parent 07bd1b20cb
commit 82b4da291b
12 changed files with 52 additions and 0 deletions

View File

@ -65,6 +65,8 @@ set(VERSION_H_PATH ${GENERATED_DIRECTORY}/include/version.h)
include(scripts/cmake/version.cmake)
sof_add_version_h_rule(${PROJECT_SOURCE_DIR}/scripts/cmake/version.cmake)
include(scripts/cmake/defconfigs.cmake)
# cmake itself cannot depend on files that don't exist
# so to make it regenerate when .config file is created,
# we make it depend on containing directory

View File

@ -0,0 +1,27 @@
# Looks for defconfig files in arch directory
set(DEFCONFIGS_DIRECTORY "${PROJECT_SOURCE_DIR}/src/arch/${ARCH}/configs/*_defconfig")
file(GLOB DEFCONFIG_PATHS ${DEFCONFIGS_DIRECTORY})
# Adds dependency on defconfigs directory
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${DEFCONFIGS_DIRECTORY})
# Adds target for every defconfig, so you we can use it like make *_defconfig
foreach(defconfig_path ${DEFCONFIG_PATHS})
get_filename_component(defconfig_name ${defconfig_path} NAME)
add_custom_target(
${defconfig_name}
COMMAND ${CMAKE_COMMAND} -E copy
${defconfig_path}
${DOT_CONFIG_PATH}
COMMAND ${CMAKE_COMMAND} -E env
srctree=${PROJECT_SOURCE_DIR}
CC_VERSION_TEXT=${CC_VERSION_TEXT}
ARCH=${ARCH}
${PYTHON3} ${PROJECT_SOURCE_DIR}/scripts/kconfig/olddefconfig.py
${PROJECT_SOURCE_DIR}/Kconfig
WORKING_DIRECTORY ${GENERATED_DIRECTORY}
COMMENT "Applying olddefconfig with ${defconfig_name}"
VERBATIM
USES_TERMINAL
)
endforeach()

View File

@ -0,0 +1,3 @@
CONFIG_SMP=y
CONFIG_APOLLOLAKE=y
CONFIG_DMIC=y

View File

@ -0,0 +1 @@
CONFIG_BAYTRAIL=y

View File

@ -0,0 +1 @@
CONFIG_BROADWELL=y

View File

@ -0,0 +1,3 @@
CONFIG_SMP=y
CONFIG_CANNONLAKE=y
CONFIG_DMIC=y

View File

@ -0,0 +1 @@
CONFIG_CHERRYTRAIL=y

View File

@ -0,0 +1 @@
CONFIG_HASWELL=y

View File

@ -0,0 +1,3 @@
CONFIG_SMP=y
CONFIG_ICELAKE=y
CONFIG_DMIC=y

View File

@ -0,0 +1,4 @@
CONFIG_SMP=y
CONFIG_APOLLOLAKE=y
CONFIG_FIRMWARE_SHORT_NAME="kbl"
CONFIG_DMIC=y

View File

@ -0,0 +1,4 @@
CONFIG_SMP=y
CONFIG_APOLLOLAKE=y
CONFIG_FIRMWARE_SHORT_NAME="skl"
CONFIG_DMIC=y

View File

@ -0,0 +1,2 @@
CONFIG_SUECREEK=y
CONFIG_DMIC=y