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

Commit 2435807

Browse files
committed
Enhanced checks for valid upload target
1 parent a628889 commit 2435807

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmake/Platform/Targets/UploadTarget.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
#=============================================================================#
66
function(set_target_upload_port _target_name _port)
77

8-
if ("${_target_name}" STREQUAL "")
8+
if (NOT TARGET ${_target_name})
99
message(FATAL_ERROR "Can't create upload target for an invalid target ${_target_name}")
10+
else ()
11+
get_target_property(target_type ${_target_name} TYPE)
12+
if (NOT ${target_type} STREQUAL "EXECUTABLE") # Target is not executable
13+
message(SEND_ERROR "Upload target ${_target_name} must be an executable target")
14+
endif ()
1015
endif ()
1116

1217
set_upload_target_flags(${_target_name} ${_port} upload_args)

0 commit comments

Comments
 (0)