cmake: Whitespace and commentary fixes

Cosmetics, no functional change expected.
Fixed leading space alignment.
Replaced tabs with spaces.
Emulation error message output is now aligned.

To locate tabs in cmake, the following bash is useful:
grep -PRil "\t" * | grep -i cmake | grep -v ^sanity

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
This commit is contained in:
Mark Ruvald Pedersen 2018-12-19 10:40:57 +01:00 committed by Carles Cufí
commit 0efad5f7fd
12 changed files with 118 additions and 120 deletions

View file

@ -34,15 +34,16 @@ if(NOT PROPERTY_LINKER_SCRIPT_DEFINES)
endif() endif()
define_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT BRIEF_DOCS " " FULL_DOCS " ") define_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT BRIEF_DOCS " " FULL_DOCS " ")
set_property( GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-little${ARCH}) set_property( GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-little${ARCH}) # BFD format
# zephyr_interface is a source-less library that has all the global # "zephyr_interface" is a source-less library that encapsulates all the global
# compiler options needed by all source files. All zephyr libraries, # compiler options needed by all source files. All zephyr libraries,
# including the library named "zephyr" link with this library to # including the library named "zephyr" link with this library to
# obtain these flags. # obtain these flags.
# https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#interface-libraries
add_library(zephyr_interface INTERFACE) add_library(zephyr_interface INTERFACE)
# zephyr is a catchall CMake library for source files that can be # "zephyr" is a catch-all CMake library for source files that can be
# built purely with the include paths, defines, and other compiler # built purely with the include paths, defines, and other compiler
# flags that come with zephyr_interface. # flags that come with zephyr_interface.
zephyr_library_named(zephyr) zephyr_library_named(zephyr)
@ -1397,7 +1398,6 @@ else()
endif() endif()
add_subdirectory(cmake/flash) add_subdirectory(cmake/flash)
add_subdirectory(cmake/usage) add_subdirectory(cmake/usage)
add_subdirectory(cmake/reports) add_subdirectory(cmake/reports)
@ -1407,14 +1407,14 @@ if(CONFIG_ASSERT AND (NOT CONFIG_FORCE_NO_ASSERT))
--- WARNING: __ASSERT() statements are globally ENABLED --- --- WARNING: __ASSERT() statements are globally ENABLED ---
--- The kernel will run more slowly and use more memory --- --- The kernel will run more slowly and use more memory ---
------------------------------------------------------------" ------------------------------------------------------------"
) )
endif() endif()
if(CONFIG_BOARD_DEPRECATED) if(CONFIG_BOARD_DEPRECATED)
message(WARNING " message(WARNING "
WARNING: The board '${BOARD}' is deprecated and will be WARNING: The board '${BOARD}' is deprecated and will be
removed in version ${CONFIG_BOARD_DEPRECATED}" removed in version ${CONFIG_BOARD_DEPRECATED}"
) )
endif() endif()
if(CONFIG_X86 AND CONFIG_USERSPACE AND NOT CONFIG_X86_NO_MELTDOWN) if(CONFIG_X86 AND CONFIG_USERSPACE AND NOT CONFIG_X86_NO_MELTDOWN)
@ -1423,5 +1423,5 @@ if(CONFIG_X86 AND CONFIG_USERSPACE AND NOT CONFIG_X86_NO_MELTDOWN)
If your CPU is vulnerable to the Meltdown CPU bug, security of If your CPU is vulnerable to the Meltdown CPU bug, security of
supervisor-only memory pages is not guaranteed. This version of Zephyr supervisor-only memory pages is not guaranteed. This version of Zephyr
does not contain a fix for this issue." does not contain a fix for this issue."
) )
endif() endif()

View file

@ -71,7 +71,7 @@ add_custom_target(code_data_relocation_target)
# CMake's 'project' concept has proven to not be very useful for Zephyr # CMake's 'project' concept has proven to not be very useful for Zephyr
# due in part to how Zephyr is organized and in part to it not fitting well # due in part to how Zephyr is organized and in part to it not fitting well
# with cross compilation. # with cross compilation.
# CMake therefore tries to rely as little as possible on project() # Zephyr therefore tries to rely as little as possible on project()
# and its associated variables, e.g. PROJECT_SOURCE_DIR. # and its associated variables, e.g. PROJECT_SOURCE_DIR.
# It is recommended to always use ZEPHYR_BASE instead of PROJECT_SOURCE_DIR # It is recommended to always use ZEPHYR_BASE instead of PROJECT_SOURCE_DIR
# when trying to reference ENV${ZEPHYR_BASE}. # when trying to reference ENV${ZEPHYR_BASE}.
@ -217,7 +217,7 @@ if(NOT BOARD_DIR)
endif() endif()
get_filename_component(BOARD_ARCH_DIR ${BOARD_DIR} DIRECTORY) get_filename_component(BOARD_ARCH_DIR ${BOARD_DIR} DIRECTORY)
get_filename_component(BOARD_FAMILY ${BOARD_DIR} NAME ) get_filename_component(BOARD_FAMILY ${BOARD_DIR} NAME)
get_filename_component(ARCH ${BOARD_ARCH_DIR} NAME) get_filename_component(ARCH ${BOARD_ARCH_DIR} NAME)
if(CONF_FILE) if(CONF_FILE)
@ -344,9 +344,10 @@ if(CONFIG_QEMU_TARGET)
-nic tap,model=${CONFIG_ETH_NIC_MODEL},script=no,downscript=no,ifname=zeth -nic tap,model=${CONFIG_ETH_NIC_MODEL},script=no,downscript=no,ifname=zeth
) )
else() else()
message(FATAL_ERROR message(FATAL_ERROR "
"No Qemu ethernet driver configured! No Qemu ethernet driver configured!
Enable Qemu supported ethernet driver like e1000 at drivers/ethernet") Enable Qemu supported ethernet driver like e1000 at drivers/ethernet"
)
endif() endif()
else() else()
list(APPEND QEMU_FLAGS_${ARCH} list(APPEND QEMU_FLAGS_${ARCH}

View file

@ -24,7 +24,7 @@
# 1.1. zephyr_* # 1.1. zephyr_*
# #
# The following methods are for modifying the CMake library[0] called # The following methods are for modifying the CMake library[0] called
# "zephyr". zephyr is a catchall CMake library for source files that # "zephyr". zephyr is a catch-all CMake library for source files that
# can be built purely with the include paths, defines, and other # can be built purely with the include paths, defines, and other
# compiler flags that all zephyr source files use. # compiler flags that all zephyr source files use.
# [0] https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html # [0] https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html
@ -1190,10 +1190,7 @@ function(find_appropriate_cache_directory dir)
set(${dir} ${local_dir} PARENT_SCOPE) set(${dir} ${local_dir} PARENT_SCOPE)
endfunction() endfunction()
function(generate_unique_target_name_from_filename function(generate_unique_target_name_from_filename filename target_name)
filename
target_name
)
get_filename_component(basename ${filename} NAME) get_filename_component(basename ${filename} NAME)
string(REPLACE "." "_" x ${basename}) string(REPLACE "." "_" x ${basename})
string(REPLACE "@" "_" x ${x}) string(REPLACE "@" "_" x ${x})

View file

@ -18,7 +18,7 @@ foreach(arch ${arch_list})
foreach(root ${BOARD_ROOT}) foreach(root ${BOARD_ROOT})
set(board_arch_dir ${root}/boards/${arch}) set(board_arch_dir ${root}/boards/${arch})
# Match the .yanl files in the board directories to make sure we are # Match the .yaml files in the board directories to make sure we are
# finding boards, e.g. qemu_xtensa/qemu_xtensa.yaml # finding boards, e.g. qemu_xtensa/qemu_xtensa.yaml
file(GLOB_RECURSE yamls_for_${arch} file(GLOB_RECURSE yamls_for_${arch}
RELATIVE ${board_arch_dir} RELATIVE ${board_arch_dir}