cmake: Style cleanup, add cmake linter to gitlab CI

This commit is contained in:
Angus Gratton
2018-03-20 12:27:00 +11:00
committed by Angus Gratton
parent 2ea359ad0c
commit b44c8b125f
6 changed files with 21 additions and 15 deletions

View File

@@ -234,6 +234,12 @@ build_docs:
- make html - make html
- ../check_doc_warnings.sh - ../check_doc_warnings.sh
verify_cmake_style:
stage: build
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
script:
tools/cmake/run_cmake_lint.sh
test_nvs_on_host: test_nvs_on_host:
stage: test stage: test
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG

View File

@@ -1,7 +1,7 @@
set(COMPONENT_SRCDIRS "." "gcov") set(COMPONENT_SRCDIRS "." "gcov")
set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_ADD_INCLUDEDIRS "include")
if (CONFIG_SYSVIEW_ENABLE) if(CONFIG_SYSVIEW_ENABLE)
list(APPEND COMPONENT_ADD_INCLUDEDIRS list(APPEND COMPONENT_ADD_INCLUDEDIRS
sys_view/Config sys_view/Config
sys_view/SEGGER sys_view/SEGGER

View File

@@ -15,7 +15,7 @@ if(CONFIG_BLUEDROID_ENABLED)
bluedroid/hci/include bluedroid/hci/include
bluedroid/osi/include bluedroid/osi/include
bluedroid/external/sbc/decoder/include bluedroid/external/sbc/decoder/include
bluedroid/external/sbc/encoder/include bluedroid/external/sbc/encoder/include
bluedroid/btc/profile/esp/blufi/include bluedroid/btc/profile/esp/blufi/include
bluedroid/btc/profile/esp/include bluedroid/btc/profile/esp/include
bluedroid/btc/profile/std/a2dp/include bluedroid/btc/profile/std/a2dp/include
@@ -51,7 +51,7 @@ if(CONFIG_BLUEDROID_ENABLED)
bluedroid/main bluedroid/main
bluedroid/osi bluedroid/osi
bluedroid/external/sbc/decoder/srce bluedroid/external/sbc/decoder/srce
bluedroid/external/sbc/encoder/srce bluedroid/external/sbc/encoder/srce
bluedroid/btc/core bluedroid/btc/core
bluedroid/btc/profile/esp/blufi bluedroid/btc/profile/esp/blufi
bluedroid/btc/profile/std/gap bluedroid/btc/profile/std/gap

View File

@@ -18,10 +18,10 @@ function(crosstool_version_check expected_ctng_version)
string(REGEX MATCH "crosstool-ng-[0-9a-g\\.-]+" ctng_version "${toolchain_stderr}") string(REGEX MATCH "crosstool-ng-[0-9a-g\\.-]+" ctng_version "${toolchain_stderr}")
string(REPLACE "crosstool-ng-" "" ctng_version "${ctng_version}") string(REPLACE "crosstool-ng-" "" ctng_version "${ctng_version}")
# We use FIND to match version instead of STREQUAL because some toolchains are built # We use FIND to match version instead of STREQUAL because some toolchains are built
# with longer git hash strings than others. This will match any version which starts with # with longer git hash strings than others. This will match any version which starts with
# the expected version string. # the expected version string.
string(FIND "${ctng_version}" "${expected_ctng_version}" found_expected_version) string(FIND "${ctng_version}" "${expected_ctng_version}" found_expected_version)
if(NOT ctng_version) if(NOT ctng_version)
message(WARNING "Xtensa toolchain ${CMAKE_C_COMPILER} does not appear to be built with crosstool-ng. " message(WARNING "Xtensa toolchain ${CMAKE_C_COMPILER} does not appear to be built with crosstool-ng. "
"${ctng_version_warning}") "${ctng_version_warning}")

View File

@@ -97,12 +97,12 @@ function(idf_set_global_compiler_options)
add_compile_options("-I${CMAKE_BINARY_DIR}") # for sdkconfig.h add_compile_options("-I${CMAKE_BINARY_DIR}") # for sdkconfig.h
# Enable ccache if it's on the path # Enable ccache if it's on the path
if(NOT CCACHE_DISABLE) if(NOT CCACHE_DISABLE)
find_program(CCACHE_FOUND ccache) find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND) if(CCACHE_FOUND)
message(STATUS "ccache will be used for faster builds") message(STATUS "ccache will be used for faster builds")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
endif() endif()
endif() endif()
endfunction() endfunction()