Skip to content

Commit 82b4da2

Browse files
jajanuszlgirdwood
authored andcommitted
cmake: defconfigs support
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
1 parent 07bd1b2 commit 82b4da2

12 files changed

Lines changed: 52 additions & 0 deletions

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ set(VERSION_H_PATH ${GENERATED_DIRECTORY}/include/version.h)
6565
include(scripts/cmake/version.cmake)
6666
sof_add_version_h_rule(${PROJECT_SOURCE_DIR}/scripts/cmake/version.cmake)
6767

68+
include(scripts/cmake/defconfigs.cmake)
69+
6870
# cmake itself cannot depend on files that don't exist
6971
# so to make it regenerate when .config file is created,
7072
# we make it depend on containing directory

scripts/cmake/defconfigs.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Looks for defconfig files in arch directory
2+
set(DEFCONFIGS_DIRECTORY "${PROJECT_SOURCE_DIR}/src/arch/${ARCH}/configs/*_defconfig")
3+
file(GLOB DEFCONFIG_PATHS ${DEFCONFIGS_DIRECTORY})
4+
5+
# Adds dependency on defconfigs directory
6+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${DEFCONFIGS_DIRECTORY})
7+
8+
# Adds target for every defconfig, so you we can use it like make *_defconfig
9+
foreach(defconfig_path ${DEFCONFIG_PATHS})
10+
get_filename_component(defconfig_name ${defconfig_path} NAME)
11+
add_custom_target(
12+
${defconfig_name}
13+
COMMAND ${CMAKE_COMMAND} -E copy
14+
${defconfig_path}
15+
${DOT_CONFIG_PATH}
16+
COMMAND ${CMAKE_COMMAND} -E env
17+
srctree=${PROJECT_SOURCE_DIR}
18+
CC_VERSION_TEXT=${CC_VERSION_TEXT}
19+
ARCH=${ARCH}
20+
${PYTHON3} ${PROJECT_SOURCE_DIR}/scripts/kconfig/olddefconfig.py
21+
${PROJECT_SOURCE_DIR}/Kconfig
22+
WORKING_DIRECTORY ${GENERATED_DIRECTORY}
23+
COMMENT "Applying olddefconfig with ${defconfig_name}"
24+
VERBATIM
25+
USES_TERMINAL
26+
)
27+
endforeach()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_SMP=y
2+
CONFIG_APOLLOLAKE=y
3+
CONFIG_DMIC=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_BAYTRAIL=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_BROADWELL=y
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_SMP=y
2+
CONFIG_CANNONLAKE=y
3+
CONFIG_DMIC=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_CHERRYTRAIL=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_HASWELL=y
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_SMP=y
2+
CONFIG_ICELAKE=y
3+
CONFIG_DMIC=y
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_SMP=y
2+
CONFIG_APOLLOLAKE=y
3+
CONFIG_FIRMWARE_SHORT_NAME="kbl"
4+
CONFIG_DMIC=y

0 commit comments

Comments
 (0)