diff --git a/Source/Tests/SConscript b/Source/Tests/SConscript index e9ad4969..32ceacb7 100644 --- a/Source/Tests/SConscript +++ b/Source/Tests/SConscript @@ -13,11 +13,18 @@ required = Split(""" mmap.cpp """) -libs = Split(""" +cppunitlibs = Split(""" cppunit """) -Import('env') +extralibs = Split(""" + dl +""") + +Import('env AddAvailableLibs') + +# Use available libraries +AddAvailableLibs(env, extralibs) # compile using msvcrt (that's how cppunit.lib is built) if 'msvc' in env['TOOLS'] or 'mstoolkit' in env['TOOLS']: @@ -28,7 +35,7 @@ env.Append(CCFLAGS = ['$EXCEPTION_FLAG']) # test for CppUnit conf = env.Configure() -cppunit = conf.CheckLibWithHeader(libs, 'cppunit/extensions/HelperMacros.h', 'C++') +cppunit = conf.CheckLibWithHeader(cppunitlibs, 'cppunit/extensions/HelperMacros.h', 'C++') conf.Finish() if cppunit: @@ -44,7 +51,7 @@ if cppunit: required_obj.append(o) # build test program - tests = env.Program(target, tests + required_obj, LIBS = libs) + tests = env.Program(target, tests + required_obj) # alias running the test to 'test' test = env.Alias('test-code', [tests], tests[0].abspath) diff --git a/Source/Tests/mmap.cpp b/Source/Tests/mmap.cpp index 5deee309..b0a71d69 100644 --- a/Source/Tests/mmap.cpp +++ b/Source/Tests/mmap.cpp @@ -5,6 +5,8 @@ #include #include +using namespace std; // for std::min + int g_display_errors = 1; FILE *g_output = stderr;