summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/dotnet.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/dotnet.cmake b/cmake/dotnet.cmake
index 9d03748..8782659 100644
--- a/cmake/dotnet.cmake
+++ b/cmake/dotnet.cmake
@@ -100,6 +100,21 @@ function(target_link_dotnet_libraries TARGET)
"" "" "${multiValueArgs}"
)
+ get_property(ALL_TARGETS GLOBAL PROPERTY DOTNET_TARGETS)
+ list(FIND ALL_TARGETS "${TARGET}" _idx)
+ if(_idx EQUAL -1)
+ message(FATAL_ERROR "target_link_dotnet_libraries: '${TARGET}' is not a dotnet target")
+ endif()
+
+ foreach(scope PUBLIC PRIVATE INTERFACE)
+ foreach(lib IN LISTS arg_${scope})
+ list(FIND ALL_TARGETS "${lib}" _idx)
+ if(_idx EQUAL -1)
+ message(FATAL_ERROR "target_link_dotnet_libraries: '${lib}' is not a dotnet target")
+ endif()
+ endforeach()
+ endforeach()
+
foreach(dep IN LISTS arg_NATIVE_DEPS)
get_property(CURRENT_NDEPS GLOBAL PROPERTY DOTNET_TARGET_${TARGET}_NATIVE_DEPS)
if(NOT CURRENT_NDEPS)