ENH: use cmake variables for cmDynamicLoader to figure out library prefix and extensions

This commit is contained in:
Bill Hoffman 2004-02-16 10:48:54 -05:00
parent 07b4d8bbca
commit c60f2fabc4
2 changed files with 18 additions and 46 deletions

View File

@ -11,3 +11,8 @@
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
#define CMAKE_DATA_DIR "@CMAKE_DATA_DIR@"
#define CMAKE_SHARED_LIBRARY_PREFIX "@CMAKE_SHARED_LIBRARY_PREFIX@"
#define CMAKE_SHARED_MODULE_PREFIX "@CMAKE_SHARED_MODULE_PREFIX@"
#define CMAKE_SHARED_LIBRARY_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@"
#define CMAKE_SHARED_MODULE_SUFFIX "@CMAKE_SHARED_MODULE_SUFFIX@"

View File

@ -137,15 +137,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
const char* cmDynamicLoader::LibPrefix()
{
return "lib";
}
const char* cmDynamicLoader::LibExtension()
{
return ".sl";
}
const char* cmDynamicLoader::LastError()
{
@ -204,16 +195,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle /* lib */, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
const char* cmDynamicLoader::LibPrefix()
{
return "lib";
}
const char* cmDynamicLoader::LibExtension()
{
return ".so";
}
const char* cmDynamicLoader::LastError()
{
return 0;
@ -272,19 +253,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
const char* cmDynamicLoader::LibPrefix()
{
#if defined( __MINGW32__ )
return "lib";
#else
return "";
#endif
}
const char* cmDynamicLoader::LibExtension()
{
return ".dll";
}
const char* cmDynamicLoader::LastError()
{
@ -346,20 +314,6 @@ cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym)
return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);
}
const char* cmDynamicLoader::LibPrefix()
{
return "lib";
}
const char* cmDynamicLoader::LibExtension()
{
#ifdef __CYGWIN__
return ".dll";
#else
return ".so";
#endif
}
const char* cmDynamicLoader::LastError()
{
return dlerror();
@ -370,3 +324,16 @@ void cmDynamicLoader::FlushCache()
{
cmDynamicLoaderCache::GetInstance()->FlushCache();
}
// Stay consistent with the Modules/Platform directory as
// to what the correct prefix and lib extension
const char* cmDynamicLoader::LibPrefix()
{
return CMAKE_SHARED_MODULE_PREFIX;
}
const char* cmDynamicLoader::LibExtension()
{
return CMAKE_SHARED_LIBRARY_SUFFIX;
}