diff options
| author | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-06-30 23:47:25 +0200 |
|---|---|---|
| committer | Bernhard Guillon <Bernhard.Guillon@begu.org> | 2026-06-30 23:47:25 +0200 |
| commit | 665524c0331cfc6eeab641dfd631aa69c109cd11 (patch) | |
| tree | 845d1b650512fadc4e80f7d99ba19d9a13a444f8 /cmake/dotnet.cmake | |
| parent | 4f0d95c1ab0a6a9ed719cfe988bd17f7eda9a66a (diff) | |
| download | csharp-cmake-665524c0331cfc6eeab641dfd631aa69c109cd11.tar.gz csharp-cmake-665524c0331cfc6eeab641dfd631aa69c109cd11.zip | |
Add target validation to target_link_dotnet_libraries
Diffstat (limited to 'cmake/dotnet.cmake')
| -rw-r--r-- | cmake/dotnet.cmake | 15 |
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) |
