Skip to content

Commit

Permalink
corrosion_install: Add some sanity checking for args
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwe committed Aug 10, 2024
1 parent 43a386e commit 2efaede
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/Corrosion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,9 @@ function(corrosion_install)

# Loop through each install target and register file installations
foreach(INSTALL_TARGET ${INSTALL_TARGETS})
if(NOT TARGET ${INSTALL_TARGET})
message(FATAL_ERROR "Install target ${INSTALL_TARGET} is not a valid target")
endif()
# Don't both implementing target type differentiation using generator expressions since
# TYPE cannot change after target creation
get_property(
Expand Down Expand Up @@ -1290,6 +1293,8 @@ function(corrosion_install)
DESTINATION ${DESTINATION}
${CONFIGURATIONS}
)
else()
message(FATAL_ERROR "Unknown target type ${TARGET_TYPE} for install target ${INSTALL_TARGET}")
endif()

if(TARGET ${INSTALL_TARGET}-shared)
Expand Down Expand Up @@ -1332,6 +1337,8 @@ function(corrosion_install)

elseif(INSTALL_TYPE STREQUAL "EXPORT")
message(FATAL_ERROR "install(EXPORT ...) not yet implemented")
else()
message(FATAL_ERROR "Unknown arg: ${INSTALL_TYPE}")
endif()
endfunction()

Expand Down

0 comments on commit 2efaede

Please sign in to comment.