Skip to content

Commit fc59bb0

Browse files
committed
cmake: extensions: Fix compliance errors
Change "if ()" to "if()" so that CI compliance checker passes. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 5dbf149 commit fc59bb0

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

cmake/modules/extensions.cmake

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ function(zephyr_library_compile_options item)
564564
string(MD5 uniqueness "${ARGV}")
565565
set(lib_name options_interface_lib_${uniqueness})
566566

567-
if (NOT TARGET ${lib_name})
567+
if(NOT TARGET ${lib_name})
568568
# Create the unique target only if it doesn't exist.
569569
add_library( ${lib_name} INTERFACE)
570570
target_compile_options(${lib_name} INTERFACE ${item} ${ARGN})
@@ -832,7 +832,7 @@ endfunction()
832832

833833
set(TYPES "FLASH" "DEBUG" "SIM" "ROBOT")
834834
function(_board_check_runner_type type) # private helper
835-
if (NOT "${type}" IN_LIST TYPES)
835+
if(NOT "${type}" IN_LIST TYPES)
836836
message(FATAL_ERROR "invalid type ${type}; should be one of: ${TYPES}")
837837
endif()
838838
endfunction()
@@ -853,7 +853,7 @@ endfunction()
853853
# the name of a runner.
854854
function(board_set_runner type runner)
855855
_board_check_runner_type(${type})
856-
if (DEFINED BOARD_${type}_RUNNER)
856+
if(DEFINED BOARD_${type}_RUNNER)
857857
message(STATUS "overriding ${type} runner ${BOARD_${type}_RUNNER}; it's now ${runner}")
858858
endif()
859859
set(BOARD_${type}_RUNNER ${runner} PARENT_SCOPE)
@@ -1409,7 +1409,7 @@ function(zephyr_linker_sources location)
14091409

14101410
# Clear destination files if this is the first time the function is called.
14111411
get_property(cleared GLOBAL PROPERTY snippet_files_cleared)
1412-
if (NOT DEFINED cleared)
1412+
if(NOT DEFINED cleared)
14131413
file(WRITE ${sections_path} "")
14141414
file(WRITE ${rom_sections_path} "")
14151415
file(WRITE ${ram_sections_path} "")
@@ -1430,7 +1430,7 @@ function(zephyr_linker_sources location)
14301430
endif()
14311431

14321432
# Choose destination file, based on the <location> argument.
1433-
if ("${location}" STREQUAL "SECTIONS")
1433+
if("${location}" STREQUAL "SECTIONS")
14341434
set(snippet_path "${sections_path}")
14351435
elseif("${location}" STREQUAL "ROM_SECTIONS")
14361436
set(snippet_path "${rom_sections_path}")
@@ -1504,7 +1504,7 @@ function(zephyr_linker_sources location)
15041504

15051505
# Remove line from other snippet file, if already used
15061506
get_property(old_path GLOBAL PROPERTY "snippet_files_used_${relpath}")
1507-
if (DEFINED old_path)
1507+
if(DEFINED old_path)
15081508
file(STRINGS ${old_path} lines)
15091509
list(FILTER lines EXCLUDE REGEX ${relpath})
15101510
string(REPLACE ";" "\n;" lines "${lines}") # Add newline to each line.
@@ -1647,7 +1647,7 @@ function(check_dtc_flag flag ok)
16471647
OUTPUT_QUIET
16481648
RESULT_VARIABLE dtc_check_ret
16491649
)
1650-
if (dtc_check_ret EQUAL 0)
1650+
if(dtc_check_ret EQUAL 0)
16511651
set(${ok} 1 PARENT_SCOPE)
16521652
else()
16531653
set(${ok} 0 PARENT_SCOPE)
@@ -3162,7 +3162,7 @@ function(zephyr_string)
31623162

31633163
zephyr_check_flags_exclusive(${CMAKE_CURRENT_FUNCTION} ZEPHYR_STRING SANITIZE ESCAPE)
31643164

3165-
if (NOT ZEPHYR_STRING_UNPARSED_ARGUMENTS)
3165+
if(NOT ZEPHYR_STRING_UNPARSED_ARGUMENTS)
31663166
message(FATAL_ERROR "Function zephyr_string() called without a return variable")
31673167
endif()
31683168

@@ -3626,7 +3626,7 @@ function(zephyr_boilerplate_watch variable)
36263626
endfunction()
36273627

36283628
function(zephyr_variable_set_too_late variable access value current_list_file)
3629-
if (access STREQUAL "MODIFIED_ACCESS")
3629+
if(access STREQUAL "MODIFIED_ACCESS")
36303630
message(WARNING
36313631
"
36323632
**********************************************************************
@@ -3832,8 +3832,8 @@ function(build_info)
38323832
endif()
38333833

38343834
string(GENEX_STRIP "${arg_list}" arg_list_no_genexes)
3835-
if (NOT "${arg_list}" STREQUAL "${arg_list_no_genexes}")
3836-
if (convert_path)
3835+
if(NOT "${arg_list}" STREQUAL "${arg_list_no_genexes}")
3836+
if(convert_path)
38373837
message(FATAL_ERROR "build_info: generator expressions unsupported on PATH entries")
38383838
endif()
38393839
set(genex_flag GENEX)
@@ -4052,7 +4052,7 @@ function(dt_node_exists var)
40524052
endforeach()
40534053

40544054
dt_path_internal(canonical "${DT_NODE_PATH}" "${DT_NODE_TARGET}")
4055-
if (DEFINED canonical)
4055+
if(DEFINED canonical)
40564056
set(${var} TRUE PARENT_SCOPE)
40574057
else()
40584058
set(${var} FALSE PARENT_SCOPE)
@@ -4593,7 +4593,7 @@ function(dt_path_internal var path target)
45934593
# If the string starts with a slash, it should be an existing
45944594
# canonical path.
45954595
dt_path_internal_exists(check "${path}" "${target}")
4596-
if (check)
4596+
if(check)
45974597
set(${var} "${path}" PARENT_SCOPE)
45984598
return()
45994599
endif()
@@ -4604,13 +4604,13 @@ function(dt_path_internal var path target)
46044604

46054605
# If there is a leading alias, append the rest of the string
46064606
# onto it and see if that's an existing node.
4607-
if (DEFINED alias_path)
4607+
if(DEFINED alias_path)
46084608
set(rest)
4609-
if (NOT "${slash_index}" EQUAL -1)
4609+
if(NOT "${slash_index}" EQUAL -1)
46104610
string(SUBSTRING "${path}" "${slash_index}" -1 rest)
46114611
endif()
46124612
dt_path_internal_exists(expanded_path_exists "${alias_path}${rest}" "${target}")
4613-
if (expanded_path_exists)
4613+
if(expanded_path_exists)
46144614
set(${var} "${alias_path}${rest}" PARENT_SCOPE)
46154615
return()
46164616
endif()
@@ -4626,7 +4626,7 @@ endfunction()
46264626
# dt_path_internal for a definition and examples of 'canonical' paths.
46274627
function(dt_path_internal_exists var path target)
46284628
get_target_property(path_prop "${target}" "DT_NODE|${path}")
4629-
if (path_prop)
4629+
if(path_prop)
46304630
set(${var} TRUE PARENT_SCOPE)
46314631
else()
46324632
set(${var} FALSE PARENT_SCOPE)
@@ -5921,7 +5921,7 @@ function(add_llext_target target_name)
59215921
cmake_parse_arguments(PARSE_ARGV 1 LLEXT "${options}" "${single_args}" "${multi_args}")
59225922

59235923
# Check that the llext subsystem is enabled for this build
5924-
if (NOT CONFIG_LLEXT)
5924+
if(NOT CONFIG_LLEXT)
59255925
message(FATAL_ERROR "add_llext_target: CONFIG_LLEXT must be enabled")
59265926
endif()
59275927

@@ -6039,7 +6039,7 @@ function(add_llext_target target_name)
60396039
# to ensure that the ELF processed for binary generation contains SLIDs.
60406040
# If executed too early, it is possible that some tools executed to modify
60416041
# the ELF file (e.g., strip) undo the work performed here.
6042-
if (CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID)
6042+
if(CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID)
60436043
set(slid_inject_cmd
60446044
${PYTHON_EXECUTABLE}
60456045
${ZEPHYR_BASE}/scripts/build/llext_inject_slids.py
@@ -6053,7 +6053,7 @@ function(add_llext_target target_name)
60536053
# .arcextmap.* sections that bloat the shstrtab. stripac removes
60546054
# these sections, but it does not remove their names from the shstrtab.
60556055
# Use GNU strip to remove these sections beforehand.
6056-
if (${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "arcmwdt")
6056+
if(${ZEPHYR_TOOLCHAIN_VARIANT} STREQUAL "arcmwdt")
60576057
set(gnu_strip_for_mwdt_cmd
60586058
${CMAKE_GNU_STRIP}
60596059
--remove-section=.arcextmap* --strip-unneeded
@@ -6195,7 +6195,7 @@ function(llext_filter_zephyr_flags filter flags outvar)
61956195
OUTPUT_VARIABLE llext_remove_flags_regexp
61966196
)
61976197
list(JOIN llext_remove_flags_regexp "|" llext_remove_flags_regexp)
6198-
if ("${llext_remove_flags_regexp}" STREQUAL "")
6198+
if("${llext_remove_flags_regexp}" STREQUAL "")
61996199
# an empty regexp would match anything, we actually need the opposite
62006200
# so set it to match empty strings
62016201
set(llext_remove_flags_regexp "^$")

cmake/modules/kernel.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ endforeach()
188188
# The Qemu supported ethernet driver should define CONFIG_ETH_NIC_MODEL
189189
# string that tells what nic model Qemu should use.
190190
if(CONFIG_QEMU_TARGET)
191-
if ((CONFIG_NET_QEMU_ETHERNET OR CONFIG_NET_QEMU_USER) AND NOT CONFIG_ETH_NIC_MODEL)
191+
if((CONFIG_NET_QEMU_ETHERNET OR CONFIG_NET_QEMU_USER) AND NOT CONFIG_ETH_NIC_MODEL)
192192
message(FATAL_ERROR "
193193
No Qemu ethernet driver configured!
194194
Enable Qemu supported ethernet driver like e1000 at drivers/ethernet"

0 commit comments

Comments
 (0)