Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 55dfe2b

Browse files
committed
Mostly cosmetic changes - Renaming & Reordering
1 parent 96dd17d commit 55dfe2b

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

cmake/Platform/Libraries/LibraryFlagsManager.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ function(set_library_flags _library_target)
2020
set_target_compile_flags(${_library_target} ${scope})
2121

2222
# Set linker flags
23-
set_linker_flags(${_library_target})
23+
set_target_linker_flags(${_library_target})
2424

2525
endfunction()

cmake/Platform/Other/TargetFlagsManager.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ endfunction()
5555
# Sets linker flags on the given target, according also to the given board ID.
5656
# _target_name - Name of the target (Executable or Library) to set flags on.
5757
#=============================================================================#
58-
function(set_linker_flags _target_name)
58+
function(set_target_linker_flags _target_name)
5959

6060
# Infer target's type and act differently if it's an interface-library
6161
get_target_property(target_type ${_target_name} TYPE)
@@ -82,7 +82,7 @@ endfunction()
8282
function(set_executable_target_flags _target_name)
8383

8484
set_target_compile_flags(${_target_name})
85-
set_linker_flags(${_target_name})
85+
set_target_linker_flags(${_target_name})
8686

8787
target_link_libraries(${_target_name} PUBLIC m) # Add math library
8888

cmake/Platform/Targets/ArduinoLibraryTarget.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function(link_arduino_library _target_name _library_target_name)
7373
get_target_property(board_id ${_target_name} BOARD_ID)
7474

7575
# Get the name of the Core-Lib target associated with the targets' 'board_id'
76-
get_core_lib_target_name(${board_id} core_lib_target)
76+
generate_core_lib_target_name(${board_id} core_lib_target)
7777

7878
if (NOT TARGET ${core_lib_target})
7979
message(FATAL_ERROR "Core Library target doesn't exist. "

cmake/Platform/Targets/CoreLibTarget.cmake

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
function(_is_board_core_valid _board_core _board_id)
66

77
list(FIND ARDUINO_CMAKE_PLATFORM_CORES "${board_core}" index)
8+
89
if (${index} LESS 0)
910
message(FATAL_ERROR "Unknown board core \"${board_core}\" for the ${_board_id} board")
1011
endif ()
@@ -18,6 +19,7 @@ endfunction()
1819
function(_is_board_variant_valid _board_variant _board_id)
1920

2021
list(FIND ARDUINO_CMAKE_PLATFORM_VARIANTS "${board_variant}" index)
22+
2123
if (${index} LESS 0)
2224
message(FATAL_ERROR "Unknown board variant \"${board_variant}\" for the ${_board_id} board")
2325
endif ()
@@ -64,23 +66,23 @@ endfunction()
6466
function(_set_core_lib_flags _core_target_name)
6567

6668
set_target_compile_flags(${_core_target_name} PUBLIC)
67-
68-
set_linker_flags(${_core_target_name})
69+
set_target_linker_flags(${_core_target_name})
6970

7071
endfunction()
7172

7273
#=============================================================================#
7374
# Adds/Creates a static library target for Arduino's core library (Core-Lib),
74-
# required by every standard Arduino Application/Executable.
75-
# The library is then linked against the given executable target
76-
# (Which also means is has to be created first).
75+
# required by every arduino target.
7776
# _target_name - Name of the Application/Executable target created earlier.
7877
# _board_id - Board to create the core library for.
7978
# Note that each board has a unique version of the library.
8079
#=============================================================================#
8180
function(add_arduino_core_lib _target_name)
8281

83-
get_core_lib_target_name(${board_id} core_lib_target)
82+
# First, retrieve the board_id associated with the target from the matching property
83+
get_target_property(board_id ${_target_name} BOARD_ID)
84+
85+
generate_core_lib_target_name(${board_id} core_lib_target)
8486

8587
if (TARGET ${core_lib_target}) # Core-lib target already created for the given board
8688
if (TARGET ${_target_name}) # Executable/Firmware target also exists
@@ -89,16 +91,13 @@ function(add_arduino_core_lib _target_name)
8991

9092
else () # Core-Lib target needs to be created
9193

92-
# First, retrieve the board_id associated with the target from the matching property
93-
get_target_property(board_id ${_target_name} BOARD_ID)
94-
9594
_get_board_core(${board_id} board_core) # Get board's core
9695
_get_board_variant(${board_id} board_variant) # Get board's variant
9796

9897
# Find sources in core directory and add the library target
9998
find_source_files("${ARDUINO_CMAKE_CORE_${board_core}_PATH}" core_sources)
10099

101-
if (${CMAKE_HOST_UNIX})
100+
if (CMAKE_HOST_UNIX)
102101
if (CMAKE_HOST_UBUNTU OR CMAKE_HOST_DEBIAN)
103102
list(FILTER core_sources EXCLUDE REGEX "[Mm]ain\\.c.*")
104103
endif ()

cmake/Platform/Targets/PlatformLibraryTarget.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function(link_platform_library _target_name _platform_library_name)
5858

5959
_add_platform_library(${_platform_library_name} ${board_id})
6060

61-
get_core_lib_target_name(${board_id} core_lib_target)
61+
generate_core_lib_target_name(${board_id} core_lib_target)
62+
6263
_link_arduino_cmake_library(${_target_name} ${_platform_library_name}
6364
${scope}
6465
BOARD_CORE_TARGET ${core_lib_target})

cmake/Platform/Utilities/StringUtils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ endfunction()
5959
# _return_var - Name of variable in parent-scope holding the return value.
6060
# Returns - Name of the core library target for the given board.
6161
#=============================================================================#
62-
function(get_core_lib_target_name _board_id _return_var)
62+
function(generate_core_lib_target_name _board_id _return_var)
6363

6464
string(REPLACE "." "_" board_id "${_board_id}")
6565

0 commit comments

Comments
 (0)