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

Commit 4e71924

Browse files
committed
Reordered scope argument-parsing function's arguments - Return var is now 1st.
Updated usages accordingly. Also updated the `link_library_flags` function to use the scope parsing function, it was somehow missed until now.
1 parent 5c2d905 commit 4e71924

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

cmake/Platform/Libraries/LibraryFlagsManager.cmake

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,8 @@
66
#=============================================================================#
77
function(set_library_flags _library_target _board_id)
88

9-
set(scope_options "PRIVATE" "PUBLIC" "INTERFACE")
10-
cmake_parse_arguments(parsed_args "${scope_options}" "" "" ${ARGN})
11-
12-
if (parsed_args_PRIVATE)
13-
set(scope PRIVATE)
14-
elseif (parsed_args_INTERFACE)
15-
set(scope INTERFACE)
16-
else ()
17-
set(scope PUBLIC)
18-
endif ()
9+
parse_scope_argument(scope "${ARGN}"
10+
DEFAULT_SCOPE PUBLIC)
1911

2012
# Set C++ compiler flags
2113
get_cmake_compliant_language_name(cpp flags_language)

cmake/Platform/Other/TargetFlagsManager.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
function(set_compiler_target_flags _target_name _board_id)
77

88
cmake_parse_arguments(parsed_args "" "LANGUAGE" "" ${ARGN})
9-
parse_scope_argument("${ARGN}" scope
9+
parse_scope_argument(scope "${ARGN}"
1010
DEFAULT_SCOPE PUBLIC)
1111

1212
if (parsed_args_LANGUAGE)

cmake/Platform/Targets/ArduinoCMakeLibraryTarget.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function(_link_arduino_cmake_library _target_name _library_name)
4848
endif ()
4949

5050
cmake_parse_arguments(parsed_args "" "BOARD_CORE_TARGET" "" ${ARGN})
51-
parse_scope_argument("${ARGN}" scope)
51+
parse_scope_argument(scope "${ARGN}")
5252

5353
# Resolve Core-Lib's target
5454
if (parsed_args_BOARD_CORE_TARGET)

cmake/Platform/Targets/PlatformLibraryTarget.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function(link_platform_library _target_name _library_name _board_id)
4949
message(FATAL_ERROR "Target ${_target_name} doesn't exist - It must be created first!")
5050
endif ()
5151

52-
parse_scope_argument("${ARGN}" scope
52+
parse_scope_argument(scope "${ARGN}"
5353
DEFAULT_SCOPE PUBLIC)
5454

5555
if (NOT TARGET ${_library_name})

cmake/Platform/Utilities/CMakeArgumentsUtils.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ endfunction()
5050
# _return_var - Name of a CMake variable that will hold the extraction result.
5151
# Returns - Parsed scope if one is found or the DEFAULT_SCOPE if set, otherwise an error.
5252
#=============================================================================#
53-
function(parse_scope_argument _cmake_args _return_var)
53+
function(parse_scope_argument _return_var _cmake_args)
5454

5555
cmake_parse_arguments(parsed_args "" "DEFAULT_SCOPE" "" ${ARGN})
5656

0 commit comments

Comments
 (0)