@@ -9,17 +9,9 @@ function(_set_target_language_flags _target_name _language _scope)
99 # Infer target's type and act differently if it's an interface-library
1010 get_target_property (target_type ${_target_name} TYPE )
1111
12- if ("${target_type} " STREQUAL "INTERFACE_LIBRARY" )
13- get_target_property (board_id ${_target_name} INTERFACE_BOARD_ID)
14- else ()
15- get_target_property (board_id ${_target_name} BOARD_ID)
16- endif ()
17- 18- parse_compiler_recipe_flags(${board_id} compiler_recipe_flags
19- LANGUAGE "${_language} " )
12+ parse_compiler_recipe_flags(${ARDUINO_CMAKE_PROJECT_BOARD} compiler_recipe_flags LANGUAGE "${_language} " )
2013
21- target_compile_options (${_target_name} ${_scope}
22- $<$<COMPILE_LANGUAGE:${_language} >:${compiler_recipe_flags} >)
14+ target_compile_options (${_target_name} ${_scope} $<$<COMPILE_LANGUAGE:${_language} >:${compiler_recipe_flags} >)
2315
2416endfunction ()
2517
@@ -60,13 +52,7 @@ function(set_target_linker_flags _target_name)
6052 # Infer target's type and act differently if it's an interface-library
6153 get_target_property (target_type ${_target_name} TYPE )
6254
63- if ("${target_type} " STREQUAL "INTERFACE_LIBRARY" )
64- get_target_property (board_id ${_target_name} INTERFACE_BOARD_ID)
65- else ()
66- get_target_property (board_id ${_target_name} BOARD_ID)
67- endif ()
68- 69- parse_linker_recpie_pattern(${board_id} linker_recipe_flags)
55+ parse_linker_recpie_pattern(${ARDUINO_CMAKE_PROJECT_BOARD} linker_recipe_flags)
7056
7157 string (REPLACE ";" " " cmake_compliant_linker_flags "${linker_recipe_flags} " )
7258
@@ -97,10 +83,8 @@ endfunction()
9783#=============================================================================#
9884function (set_upload_target_flags _target_name _upload_port _return_var)
9985
100- get_target_property (board_id ${_target_name} BOARD_ID)
101- 10286 # Parse and append recipe flags
103- parse_upload_recipe_pattern(${board_id } "${_upload_port} " upload_recipe_flags)
87+ parse_upload_recipe_pattern(${ARDUINO_CMAKE_PROJECT_BOARD } "${_upload_port} " upload_recipe_flags)
10488 list (APPEND upload_flags "${upload_recipe_flags} " )
10589
10690 set (target_binary_base_path "${CMAKE_CURRENT_BINARY_DIR} /${_target_name} " )
0 commit comments