From 603687a6ad92f273652d507957d334905498c5de Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 16 Sep 2021 23:35:32 +0000 Subject: [PATCH 1/3] cmake: do not download submodules when BUILD_UNIT_TESTS Faster CI. Signed-off-by: Marc Herbert --- scripts/cmake/git-submodules.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/git-submodules.cmake b/scripts/cmake/git-submodules.cmake index be20ded90440..07db23f9e911 100644 --- a/scripts/cmake/git-submodules.cmake +++ b/scripts/cmake/git-submodules.cmake @@ -32,7 +32,7 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git") "There are submodule changes, check git status and git diff\n${stdout}") endif() - else() + elseif(NOT BUILD_UNIT_TESTS) # Automated initialization for convenience. You can defeat it by # manually initializing rimage and _not_ some other # submodule. In that case you get the warning above. From 3e09ebda71f71c59b24e701b9fb12d520aa6f804 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 17 Sep 2021 05:35:21 +0000 Subject: [PATCH 2/3] cmake: add the -Irimage #include path only for the modules that need it Fixes 177d9bd073f ("cmake: defer the rimage build until it's actually needed.") that corrected the rimage dependency but forgot about the include. This allows building the testbench without fetching rimage. Signed-off-by: Marc Herbert --- CMakeLists.txt | 1 - src/arch/xtensa/CMakeLists.txt | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cafb26c905e..bf59ef084fcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,6 @@ set(CMAKE_ASM_FLAGS -DASSEMBLY) add_library(sof_public_headers INTERFACE) target_include_directories(sof_public_headers INTERFACE ${PROJECT_SOURCE_DIR}/src/include) -target_include_directories(sof_public_headers INTERFACE ${PROJECT_SOURCE_DIR}/rimage/src/include) # interface library that is used only as container for sof binary options # other targets can use it to build with the same options diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt index 0f24518c4567..cb2ee2477daf 100644 --- a/src/arch/xtensa/CMakeLists.txt +++ b/src/arch/xtensa/CMakeLists.txt @@ -266,6 +266,11 @@ if(build_bootloader) add_dependencies(boot_module rimage_ep) add_dependencies(base_module rimage_ep) + target_include_directories(bootloader PRIVATE ${PROJECT_SOURCE_DIR}/rimage/src/include) + target_include_directories(boot_module PRIVATE ${PROJECT_SOURCE_DIR}/rimage/src/include) + target_include_directories(base_module PRIVATE ${PROJECT_SOURCE_DIR}/rimage/src/include) + + target_link_libraries(bootloader PRIVATE sof_options) add_local_sources(bootloader xtos/_vectors.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_entry.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_loader.c) target_link_libraries(bootloader PRIVATE reset) From 059cc67a120ee9942e3ce3eddf5dbef7884b1703 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 17 Sep 2021 05:41:51 +0000 Subject: [PATCH 3/3] cmake/github: do not download rimage when CONFIG_LIBRARY/testbench Faster CI and will catch any accidental dependency sneaking in. Signed-off-by: Marc Herbert --- .github/workflows/pull-request.yml | 2 +- scripts/cmake/git-submodules.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 713b3083fb7b..885ea278d373 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -59,7 +59,7 @@ jobs: steps: - uses: actions/checkout@v2 - with: {fetch-depth: 0, submodules: recursive} + with: {fetch-depth: 5} - name: docker run: docker pull thesofproject/sof && docker tag thesofproject/sof sof diff --git a/scripts/cmake/git-submodules.cmake b/scripts/cmake/git-submodules.cmake index 07db23f9e911..44c19533bda3 100644 --- a/scripts/cmake/git-submodules.cmake +++ b/scripts/cmake/git-submodules.cmake @@ -32,7 +32,8 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git") "There are submodule changes, check git status and git diff\n${stdout}") endif() - elseif(NOT BUILD_UNIT_TESTS) + elseif(NOT BUILD_UNIT_TESTS AND + NOT CONFIG_LIBRARY) # Automated initialization for convenience. You can defeat it by # manually initializing rimage and _not_ some other # submodule. In that case you get the warning above.