summaryrefslogtreecommitdiffstats
path: root/Source/cmLoadCommandCommand.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-23 17:11:39 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-23 17:11:39 (GMT)
commit5843ae455e86be59425910f510d211a9cf8a2eeb (patch)
tree1986444dbd6853b37c434f6d06694a49cd8f97b1 /Source/cmLoadCommandCommand.cxx
parent6a096be9246436118fdc40a997d21544388457ad (diff)
downloadCMake-5843ae455e86be59425910f510d211a9cf8a2eeb.zip
CMake-5843ae455e86be59425910f510d211a9cf8a2eeb.tar.gz
CMake-5843ae455e86be59425910f510d211a9cf8a2eeb.tar.bz2
Fix loading of module for borland
Diffstat (limited to 'Source/cmLoadCommandCommand.cxx')
-rw-r--r--Source/cmLoadCommandCommand.cxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index 94a0437..cc78ce2 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -186,7 +186,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& argsIn)
this->SetError("Attempt to load command failed.");
return false;
}
-
+
// try loading the shared library / dll
cmLibHandle lib = cmDynamicLoader::OpenLibrary(fullPath.c_str());
if(lib)
@@ -196,9 +196,21 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& argsIn)
CM_NAME_FUNCTION nameFunction
= (CM_NAME_FUNCTION)
cmDynamicLoader::GetSymbolAddress(lib, "cmGetName");
+ if ( !nameFunction )
+ {
+ nameFunction =
+ (CM_NAME_FUNCTION)(
+ cmDynamicLoader::GetSymbolAddress(lib, "_cmGetName"));
+ }
CM_INIT_FUNCTION initFunction
= (CM_INIT_FUNCTION)
cmDynamicLoader::GetSymbolAddress(lib, "cmInitializeCommand");
+ if ( !initFunction )
+ {
+ initFunction =
+ (CM_INIT_FUNCTION)(
+ cmDynamicLoader::GetSymbolAddress(lib, "_cmInitializeCommand"));
+ }
// if the symbol is found call it to set the name on the
// function blocker
if(nameFunction)
@@ -208,13 +220,15 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& argsIn)
f->m_commandName = (*nameFunction)();
if (!initFunction)
{
- this->SetError("Attempt to load command failed. No init function found.");
+ this->SetError("Attempt to load command failed. "
+ "No init function found.");
return false;
}
(*initFunction)(&f->info);
m_Makefile->AddCommand(f);
+ return true;
}
}
- return true;
+ return false;
}