disable dlclose when building with --coverage - refs #3344

This commit is contained in:
Dane Springmeyer 2016-03-03 15:02:03 -08:00
parent 833703026d
commit 23fb010ea2
2 changed files with 6 additions and 0 deletions

View file

@ -304,6 +304,7 @@ opts.AddVariables(
('CONFIG', "The path to the python file in which to save user configuration options. Currently : '%s'" % SCONS_LOCAL_CONFIG,SCONS_LOCAL_CONFIG),
BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'),
BoolVariable('NO_ATEXIT', 'Will prevent Singletons from being deleted atexit of main thread', 'False'),
BoolVariable('NO_DLCLOSE', 'Will prevent plugins from being unloaded', 'False'),
# http://www.scons.org/wiki/GoFastButton
# http://stackoverflow.com/questions/1318863/how-to-optimize-an-scons-script
BoolVariable('FAST', "Make SCons faster at the cost of less precise dependency tracking", 'False'),
@ -1731,6 +1732,9 @@ if not preconfigured:
if env['NO_ATEXIT']:
env.Append(CPPDEFINES = '-DMAPNIK_NO_ATEXIT')
if env['NO_DLCLOSE'] or env['COVERAGE']:
env.Append(CPPDEFINES = '-DMAPNIK_NO_DLCLOSE')
# Mac OSX (Darwin) special settings
if env['PLATFORM'] == 'Darwin':
pthread = ''

View file

@ -93,7 +93,9 @@ PluginInfo::~PluginInfo()
*/
if (module_->dl && name_ != "gdal" && name_ != "ogr")
{
#ifndef MAPNIK_NO_DLCLOSE
dlclose(module_->dl),module_->dl=0;
#endif
}
#endif
delete module_;