]> granicus.if.org Git - esp-idf/commitdiff
cmake: Style cleanup, add cmake linter to gitlab CI
authorAngus Gratton <angus@espressif.com>
Tue, 20 Mar 2018 01:27:00 +0000 (12:27 +1100)
committerAngus Gratton <gus@projectgus.com>
Sun, 29 Apr 2018 23:59:20 +0000 (09:59 +1000)
.gitlab-ci.yml
components/app_trace/CMakeLists.txt
components/bt/CMakeLists.txt
tools/cmake/crosstool_version_check.cmake
tools/cmake/idf_functions.cmake
tools/cmake/project.cmake

index a0e579ea1a40a95bb7067becd4d2563cae782b4e..d18cfa8a3f6eeeafc546c91361a078970aab0168 100644 (file)
@@ -234,6 +234,12 @@ build_docs:
     - make html
     - ../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:
   stage: test
   image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
index ebdfd941c81528a93fe2b631395549180357436a..fec9b921d6b15f93695e14e539fb21b206869e56 100644 (file)
@@ -1,7 +1,7 @@
 set(COMPONENT_SRCDIRS "." "gcov")
 set(COMPONENT_ADD_INCLUDEDIRS "include")
 
-if (CONFIG_SYSVIEW_ENABLE)
+if(CONFIG_SYSVIEW_ENABLE)
     list(APPEND COMPONENT_ADD_INCLUDEDIRS
         sys_view/Config
         sys_view/SEGGER
index f802be0f184ac63f82bbc068b80200cfb36147fa..9431645e8404b4511f1221ae9cea897c77e0c886 100644 (file)
@@ -15,7 +15,7 @@ if(CONFIG_BLUEDROID_ENABLED)
         bluedroid/hci/include
         bluedroid/osi/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/include
         bluedroid/btc/profile/std/a2dp/include
@@ -51,7 +51,7 @@ if(CONFIG_BLUEDROID_ENABLED)
         bluedroid/main
         bluedroid/osi
         bluedroid/external/sbc/decoder/srce
-           bluedroid/external/sbc/encoder/srce
+        bluedroid/external/sbc/encoder/srce
         bluedroid/btc/core
         bluedroid/btc/profile/esp/blufi
         bluedroid/btc/profile/std/gap
index f55f121d3b43cdf07b472d56878a740ab89d6555..d572a82a7f75a8045d7c2fdf9bbd51eac891a349 100644 (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(REPLACE "crosstool-ng-" "" ctng_version "${ctng_version}")
-       # 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
-       # the expected version string.
-       string(FIND "${ctng_version}" "${expected_ctng_version}" found_expected_version)
+    # 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
+    # the expected version string.
+    string(FIND "${ctng_version}" "${expected_ctng_version}" found_expected_version)
     if(NOT ctng_version)
         message(WARNING "Xtensa toolchain ${CMAKE_C_COMPILER} does not appear to be built with crosstool-ng. "
             "${ctng_version_warning}")
index 923478231002e1b345d322aace26d663453b536d..e88e980af82b718cca98d94611df85c61aa02958 100644 (file)
@@ -18,7 +18,7 @@ macro(idf_set_global_variables)
     # (cmake calls this CMAKE_SOURCE_DIR, keeping old name for compatibility.)
     set(PROJECT_PATH "${CMAKE_SOURCE_DIR}")
 
-    # Note: Unlike older build system, "main" is no longer a component. See build docs for details.    
+    # Note: Unlike older build system, "main" is no longer a component. See build docs for details.
     set_default(COMPONENT_DIRS "${PROJECT_PATH}/components ${EXTRA_COMPONENT_DIRS} ${IDF_PATH}/components")
     spaces2list(COMPONENT_DIRS)
 
@@ -97,12 +97,12 @@ function(idf_set_global_compiler_options)
     add_compile_options("-I${CMAKE_BINARY_DIR}") # for sdkconfig.h
 
     # Enable ccache if it's on the path
-       if(NOT CCACHE_DISABLE)
-               find_program(CCACHE_FOUND ccache)
-               if(CCACHE_FOUND)
-                       message(STATUS "ccache will be used for faster builds")                 
-                       set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)                
-               endif()
+    if(NOT CCACHE_DISABLE)
+        find_program(CCACHE_FOUND ccache)
+        if(CCACHE_FOUND)
+            message(STATUS "ccache will be used for faster builds")
+            set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+        endif()
     endif()
 
 endfunction()
index b9fe126b98e2eea378250c25844cbdc794a46e14..115963c56ba6342c21877be8e28f21893bb2c97e 100644 (file)
@@ -7,7 +7,7 @@ set(IDF_PATH "$ENV{IDF_PATH}")
 if(NOT IDF_PATH)
     # Documentation says you should set IDF_PATH in your environment, but we
     # can infer it here if it's not set.
-    set(IDF_PATH ${CMAKE_CURRENT_LIST_DIR})    
+    set(IDF_PATH ${CMAKE_CURRENT_LIST_DIR})
 endif()
 file(TO_CMAKE_PATH "${IDF_PATH}" IDF_PATH)
 set($ENV{IDF_PATH} "${IDF_PATH}")