Example #1
0
def add_search_path(env, library):
    """Add the named dependency to the search path of the given environment.
    *Note* that this function should not be called. Use the corresponding
    method from the Environment class instead."""

    libs = _config_store.get_library_path(library)
    include = _config_store.get_include_path(library)
    python = _config_store.get_python_path(library)
    env.Prepend(LIBPATH=libs, CPPPATH=include)
    env.PrependENVPath(oshelper.get_library_search_path_env(), libs)
    env.PrependENVPath('PYTHONPATH', python)
Example #2
0
 def __new__(cls):
     result = cls.env.Clone()
     path_manager = cls.collect_path()
     result.PrependUnique(
         LIBPATH=path_manager.get_library_path(),
         CPPPATH=path_manager.get_include_path(),
         LIBS=path_manager.get_libraries(),
     )
     result.PrependENVPath(oshelper.get_library_search_path_env(),
                           path_manager.get_library_path())
     result.PrependENVPath('PYTHONPATH', path_manager.get_python_path())
     return result
Example #3
0
def _build_environment():
    result = scons.Environment(options=options)
    result.Tool('subst', toolpath=[os.path.dirname(__file__) + '/tools'])

    if 'icpc' in result['CXX']:
        result.Append(CCFLAGS='-wd177,383,424,810,981,1418,1419,1572')
        result.Append(LINKFLAGS='-static-intel')

    if oshelper.os_is_windows():
        if result.get('OPENSCENEGRAPH_DEBUG',
                      None):  # FIXME move this elswhere
            result.Append(
                CXXFLAGS=
                '/EHsc /W3 /MDd /wd4099 /wd4244 /wd4800 /wd4996 /wd4251 /wd4661'
            )  # FIXME remove deactivation of warnings
        else:
            result.Append(CXXFLAGS=[
                '/EHsc', '/W3', '/MD', '/wd4099', '/wd4244', '/wd4800',
                '/wd4996', '/wd4251', '/wd4661'
            ])  # FIXME remove deactivation of warnings

        result.Append(CPPDEFINES=['AV_INSTANTIATE_FIELD_TEMPLATES'])

        result.Append(CCFLAGS='/bigobj')
        result.Append(LINKFLAGS=['/MANIFEST'])
        result['SHLINKCOM'] = [
            result['SHLINKCOM'],
            'mt.exe -nologo -manifest ${TARGET}.manifest -outputresource:$TARGET;2'
        ]
    else:
        result.Append(CCFLAGS='-ansi -Wall')

    if result['DEBUG']:
        if oshelper.os_is_windows():
            result.Append(CCFLAGS='/DEBUG /Zi /D_DEBUG /Ob0 /Od /RTC1')
        else:
            result.Append(CCFLAGS='-g')
    else:
        if not oshelper.os_is_windows():
            result.Append(CCFLAGS='-O2 -DNDEBUG')
            if result['CXX'] == 'g++':
                result.Append(CCFLAGS='-fno-strict-aliasing')

    if result['TRACE_LOGGING']:
        result.Append(CPPDEFINES='TRACE_LOGGING')

    if result['BUILD_32']:
        #linux or mac
        if not oshelper.os_is_windows():
            result.Append(CCFLAGS='-m32')
            result.Append(LINKFLAGS='-m32')
        #windows
        else:
            result.Append(CPPDEFINES=['WIN32'])
    else:
        if oshelper.os_is_windows():
            result.Append(CPPDEFINES=['WIN32'])
            result.Append(LINKFLAGS='/MACHINE:X64')

    result.PrependENVPath('PATH', result['BINARY_PATH'])
    result.Prepend(CPPPATH=result['INCLUDE_PATH'].split(os.pathsep))
    result.Prepend(LIBPATH=result['LIBRARY_PATH'].split(os.pathsep))
    result.PrependENVPath(oshelper.get_library_search_path_env(),
                          result['LIBRARY_PATH'])
    result.PrependENVPath('PYTHONPATH', result['PYTHON_PATH'])
    result.PrependENVPath('PKG_CONFIG_PATH', result['PKG_CONFIG_PATH'])
    os.environ['PKG_CONFIG_PATH'] = result['PKG_CONFIG_PATH']
    return result