From 7b50d4352ca7f8fe0879e9fdee57c03c64293ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 4 Jan 2009 08:38:19 +0000 Subject: [PATCH] Add a check to not mix up host and target modules Should probably be moved later outside of backend directory svn path=/trunk/; revision=38549 --- .../tools/rbuild/backend/mingw/modulehandler.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 0f83a5660be..c8c14dd2eb7 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -778,6 +778,22 @@ MingwModuleHandler::GenerateMacros ( if ( data.libraries.size () > 0 ) { + // Check if host and target modules are not mixed up + HostType current = ModuleHandlerInformations[module.type].DefaultHost; + std::vector::const_iterator it; + for ( it = data.libraries.begin(); it != data.libraries.end(); ++it ) + { + HostType imported = ModuleHandlerInformations[(*it)->importedModule->type].DefaultHost; + if (current != imported) + { + throw InvalidOperationException ( __FILE__, + __LINE__, + "Module '%s' imports module '%s', which is not of the right type", + module.name.c_str (), + (*it)->importedModule->name.c_str () ); + } + } + string deps = GenerateImportLibraryDependenciesFromVector ( data.libraries ); if ( deps.size () > 0 ) {