BUG: fix load command stuff for cygwin and cleanup at exit
This commit is contained in:
parent
04d8ba688c
commit
a63f7ba43c
|
@ -7,6 +7,7 @@
|
||||||
#include "CMakeCommandLineInfo.h"
|
#include "CMakeCommandLineInfo.h"
|
||||||
#include "../cmListFileCache.h"
|
#include "../cmListFileCache.h"
|
||||||
#include "../cmCacheManager.h"
|
#include "../cmCacheManager.h"
|
||||||
|
#include "../cmDynamicLoader.h"
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
#define new DEBUG_NEW
|
#define new DEBUG_NEW
|
||||||
|
@ -77,6 +78,7 @@ BOOL CMakeSetup::InitInstance()
|
||||||
|
|
||||||
// clean up globals
|
// clean up globals
|
||||||
cmListFileCache::GetInstance()->ClearCache();
|
cmListFileCache::GetInstance()->ClearCache();
|
||||||
|
cmDynamicLoader::FlushCache();
|
||||||
// Since the dialog has been closed, return FALSE so that we exit the
|
// Since the dialog has been closed, return FALSE so that we exit the
|
||||||
// application, rather than start the application's message pump.
|
// application, rather than start the application's message pump.
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -32,6 +32,7 @@ cmTarget.o \
|
||||||
cmCustomCommand.o \
|
cmCustomCommand.o \
|
||||||
cmCacheManager.o \
|
cmCacheManager.o \
|
||||||
cmListFileCache.o \
|
cmListFileCache.o \
|
||||||
|
cmDynamicLoader.o \
|
||||||
cmSourceGroup.o
|
cmSourceGroup.o
|
||||||
|
|
||||||
DEPENDS = cmConfigure.h
|
DEPENDS = cmConfigure.h
|
||||||
|
@ -53,6 +54,7 @@ cmLocalUnixMakefileGenerator.o : $(DEPENDS)
|
||||||
cmCommands.o : $(DEPENDS) $(srcdir)/*Command*.cxx
|
cmCommands.o : $(DEPENDS) $(srcdir)/*Command*.cxx
|
||||||
cmTarget.o : $(DEPENDS)
|
cmTarget.o : $(DEPENDS)
|
||||||
cmCacheManager.o : $(DEPENDS)
|
cmCacheManager.o : $(DEPENDS)
|
||||||
|
cmDynamicLoader.o : $(DEPENDS)
|
||||||
cmSourceGroup.o : $(DEPENDS)
|
cmSourceGroup.o : $(DEPENDS)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = 0;
|
||||||
|
|
||||||
cmDynamicLoaderCache::~cmDynamicLoaderCache()
|
cmDynamicLoaderCache::~cmDynamicLoaderCache()
|
||||||
{
|
{
|
||||||
this->FlushCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmDynamicLoaderCache::CacheFile(const char* path, const cmLibHandle& p)
|
void cmDynamicLoaderCache::CacheFile(const char* path, const cmLibHandle& p)
|
||||||
|
@ -71,13 +70,16 @@ bool cmDynamicLoaderCache::GetCacheFile(const char* path, cmLibHandle& p)
|
||||||
bool cmDynamicLoaderCache::FlushCache(const char* path)
|
bool cmDynamicLoaderCache::FlushCache(const char* path)
|
||||||
{
|
{
|
||||||
std::map<std::string, cmLibHandle>::iterator it = m_CacheMap.find(path);
|
std::map<std::string, cmLibHandle>::iterator it = m_CacheMap.find(path);
|
||||||
|
bool ret = false;
|
||||||
if ( it != m_CacheMap.end() )
|
if ( it != m_CacheMap.end() )
|
||||||
{
|
{
|
||||||
cmDynamicLoader::CloseLibrary(it->second);
|
cmDynamicLoader::CloseLibrary(it->second);
|
||||||
m_CacheMap.erase(it);
|
m_CacheMap.erase(it);
|
||||||
return true;
|
ret = true;
|
||||||
}
|
}
|
||||||
return false;
|
delete cmDynamicLoaderCache::Instance;
|
||||||
|
cmDynamicLoaderCache::Instance = 0;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmDynamicLoaderCache::FlushCache()
|
void cmDynamicLoaderCache::FlushCache()
|
||||||
|
|
|
@ -17,8 +17,20 @@
|
||||||
#include "cmakewizard.h"
|
#include "cmakewizard.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
#include "cmCacheManager.h"
|
#include "cmCacheManager.h"
|
||||||
|
#include "cmDynamicLoader.h"
|
||||||
|
#include "cmListFileCache.h"
|
||||||
|
|
||||||
|
int do_cmake(int ac, char** av);
|
||||||
|
|
||||||
int main(int ac, char** av)
|
int main(int ac, char** av)
|
||||||
|
{
|
||||||
|
int ret = do_cmake(ac, av);
|
||||||
|
cmDynamicLoader::FlushCache();
|
||||||
|
cmListFileCache::GetInstance()->ClearCache();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int do_cmake(int ac, char** av)
|
||||||
{
|
{
|
||||||
bool wiz = false;
|
bool wiz = false;
|
||||||
bool command = false;
|
bool command = false;
|
||||||
|
@ -54,6 +66,5 @@ int main(int ac, char** av)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
cmake cm;
|
cmake cm;
|
||||||
int ret = cm.Run(args);
|
return cm.Run(args);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue