def _RealRequire(env): quiet, cfg = GetConf(env, hdf5_inc) if hdf5_inc: env.Append(CPPPATH=[hdf5_inc]) if hdf5_lib: env.Append(LIBPATH=[hdf5_lib]) if hl: excons.Link(env, hdf5hl_libname, static=hdf5_static, force=True, silent=True) excons.Link(env, hdf5_libname, static=hdf5_static, force=True, silent=True) if hdf5_static: if not quiet: excons.PrintOnce("Static build", tool="hdf5") if cfg["threadsafe"]: threads.Require(env) if cfg["zlib"]: if excons.GetArgument("zlib-static", None) is None: if not quiet: excons.PrintOnce("Force static zlib", tool="hdf5") excons.SetArgument("zlib-static", 1) zlib.Require(env) if cfg["szip"]: if excons.GetArgument("szip-static", None) is None: if not quiet: excons.PrintOnce("Force static szip", tool="hdf5") excons.SetArgument("szip-static", 1) szip.Require(env)
def Require(env): glutinc, glutlib = excons.GetDirs("glut") if glutinc: env.Append(CPPPATH=[glutinc]) if glutlib: env.Append(LIBPATH=[glutlib]) static = (excons.GetArgument("glut-static", 0, int) != 0) libname = excons.GetArgument("glut-name", "") if not libname: libprefix = excons.GetArgument("glut-prefix", "") libsuffix = excons.GetArgument("glut-suffix", "") if sys.platform == "win32": libname = ("glut64" if excons.Build64() else "glut32") + libsuffix else: libname = "%sglut%s" % (libprefix, libsuffix) if sys.platform == "win32": env.Append(CPPDEFINES=["GLUT_NO_LIB_PRAGMA"]) env.Append(LIBS=[libname]) elif sys.platform == "darwin": env.Append(LINKFLAGS=" -framework GLUT") else: excons.Link(env, libname, static=static, force=True, silent=True) excons.AddHelpOptions(glut=GetOptionsString())
def Require(env): zlibinc, zliblib = excons.GetDirs("zlib") if zlibinc: env.Append(CPPPATH=[zlibinc]) if zliblib: env.Append(LIBPATH=[zliblib]) static = (excons.GetArgument("zlib-static", 0, int) != 0) if str(Platform()) != "win32": zlib_name = excons.GetArgument("zlib-name", None) if not zlib_name: zlib_name = "%sz%s" % (excons.GetArgument( "zlib-prefix", ""), excons.GetArgument("zlib-suffix", "")) else: if static: zlib_name = excons.GetArgument("zlib-name", None) if not zlib_name: zlib_name = "zlib%s" % excons.GetArgument("zlib-suffix", "") else: zlib_name = excons.GetArgument("zlib-name", None) if not zlib_name: zlib_name = "zdll%s" % excons.GetArgument("zlib-suffix", "") env.Append(CPPDEFINES=["ZLIB_DLL"]) excons.Link(env, zlib_name, static=static, force=True, silent=True) excons.AddHelpOptions(zlib=GetOptionsString())
def Require(env): szip_inc, szip_lib = excons.GetDirs("szip") if szip_inc: env.Append(CPPPATH=[szip_inc]) if szip_lib: env.Append(LIBPATH=[szip_lib]) szip_static = (excons.GetArgument("szip-static", 0, int) != 0) if not szip_static: env.Append(CPPDEFINES=["SZ_BUILT_AS_DYNAMIC_LIB"]) szip_libname = excons.GetArgument("szip-name", None) if not szip_libname: szip_libprefix = excons.GetArgument("szip-prefix", "") szip_libsuffix = excons.GetArgument("szip-suffix", "") szip_libname = "%s%s%s" % (szip_libprefix, ("sz" if sys.platform != "win32" else "libszip"), szip_libsuffix) excons.Link(env, szip_libname, static=szip_static, force=True, silent=True) excons.AddHelpOptions(szip=GetOptionsString())
def _RequireLLVM(env): env.Append(CPPFLAGS=cfg["cppflags"]) if "incdir" in cfg: env.Append(CPPPATH=[cfg["incdir"]]) if "libdir" in cfg: env.Append(LIBPATH=[cfg["libdir"]]) for lib in cfg["libs"]: excons.Link(env, lib, static=True, force=True, silent=False) env.Append(LIBS=cfg["syslibs"]) excons.AddHelpOptions(llvm=GetOptionsString())
def _RealRequire(env): # Add python bindings first if python: if pystatic: env.Append(CPPDEFINES=["PLATFORM_BUILD_STATIC"]) if sys.platform != "win32": env.Append(CPPDEFINES=["PLATFORM_VISIBILITY_AVAILABLE"]) if pyilmbase_inc: env.Append( CPPPATH=[pyilmbase_inc, os.path.dirname(pyilmbase_inc)]) if pyilmbase_lib: env.Append(LIBPATH=[pyilmbase_lib]) excons.Link(env, "%sPyImath%s" % (pyilmbase_libprefix, pyilmbase_libsuffix), static=pystatic, silent=True) excons.Link(env, "%sPyIex%s" % (pyilmbase_libprefix, pyilmbase_libsuffix), static=pystatic, silent=True) if ilmbase_inc: env.Append(CPPPATH=[ilmbase_inc, os.path.dirname(ilmbase_inc)]) if ilmbase_lib: env.Append(LIBPATH=[ilmbase_lib]) if sys.platform == "win32" and not static: env.Append(CPPDEFINES=["OPENEXR_DLL"]) if ilmthread: # ilmthread will be False if halfonly is True libname = "%sIlmThread%s" % (ilmbase_libprefix, ilmbase_libsuffix) excons.Link(env, libname, static=static, force=True, silent=True) if not halfonly: libname = "%sImath%s" % (ilmbase_libprefix, ilmbase_libsuffix) excons.Link(env, libname, static=static, force=True, silent=True) if iexmath: # iexmath will be False if halfonly is True libname = "%sIexMath%s" % (ilmbase_libprefix, ilmbase_libsuffix) excons.Link(env, libname, static=static, force=True, silent=True) if not halfonly: libname = "%sIex%s" % (ilmbase_libprefix, ilmbase_libsuffix) excons.Link(env, libname, static=static, force=True, silent=True) libname = "%sHalf%s" % (ilmbase_libprefix, ilmbase_libsuffix) excons.Link(env, libname, static=static, force=True, silent=True)
def Require(env): mtoa_inc, mtoa_lib = excons.GetDirs("mtoa", libdirname=("lib" if sys.platform == "win32" else "bin")) if sys.platform == "darwin": env.Append(CPPDEFINES=["_DARWIN"]) elif sys.platform == "win32": env.Append(CPPDEFINES=["_WIN32"]) else: env.Append(CPPDEFINES=["_LINUX"]) env.Append(CPPPATH=[mtoa_inc]) env.Append(LIBPATH=[mtoa_lib]) excons.Link(env, "mtoa_api", static=False, force=True, silent=True) excons.AddHelpOptions(mtoa=GetOptionsString())
def _RequireOpenEXR(env): if sys.platform == "win32" and not openexr_static: env.Append(CPPDEFINES=["OPENEXR_DLL"]) if openexr_inc: env.Append(CPPPATH=[openexr_inc, os.path.dirname(openexr_inc)]) if openexr_lib: env.Append(LIBPATH=[openexr_lib]) excons.Link(env, openexr_libname, static=openexr_static, force=True, silent=True) if ilmbase: excons.tools.ilmbase.Require()(env) if zlib: excons.tools.zlib.Require(env)
def Require(env): glew_inc, glew_lib = excons.GetDirs("glew") glew_static = (excons.GetArgument("glew-static", 1, int) != 0) glew_no_glu = (excons.GetArgument("glew-noglu", 1, int) != 0) glew_mx = (excons.GetArgument("glew-mx", 0, int) != 0) if glew_inc: env.Append(CPPPATH=[glew_inc]) if glew_lib: env.Append(LIBPATH=[glew_lib]) defs = [] if glew_no_glu: defs.append("GLEW_NO_GLU") if glew_static: defs.append("GLEW_STATIC") if glew_mx: defs.append("GLEW_MX") env.Append(CPPDEFINES=defs) glew_libname = excons.GetArgument("glew-name", None) if not glew_libname: glew_libprefix = excons.GetArgument("glew-prefix", "") glew_libsuffix = excons.GetArgument("glew-suffix", "") glew_libname = glew_libprefix + ("glew32" if sys.platform == "win32" else "GLEW") + glew_libsuffix if glew_mx: glew_libname += "mx" if sys.platform == "win32" and glew_static: glew_libname += "s" excons.Link(env, glew_libname, static=glew_static, force=True, silent=True) excons.AddHelpOptions(glew=GetOptionsString())
def Require(env): tbbinc, tbblib = excons.GetDirs("tbb") if tbbinc: env.Append(CPPPATH=[tbbinc]) if tbblib: env.Append(LIBPATH=[tbblib]) static = (excons.GetArgument("tbb-static", 0, int) != 0) # Any specific defines? #env.Append(CPPDEFINES=[]) tbblibname = excons.GetArgument("tbb-name", None) if not tbblibname: tbblibname = "%stbb%s" % (excons.GetArgument("tbb-prefix", ""), excons.GetArgument("tbb-suffix", "")) excons.Link(env, tbblibname, static=static, force=True, silent=True) excons.AddHelpOptions(tbb=GetOptionsString())
def Require(env): fiinc, filib = excons.GetDirs("freeimage") if fiinc: env.Append(CPPPATH=[fiinc]) if filib: env.Append(LIBPATH=[filib]) static = (excons.GetArgument("freeimage-static", 0, int) != 0) if static: env.Append(CPPDEFINES=["FREEIMAGE_LIB"]) filibname = excons.GetArgument("freeimage-name", None) if not filibname: filibprefix = excons.GetArgument("freeimage-prefix", "") filibsuffix = excons.GetArgument("freeimage-suffix", "") filibname = "%sfreeimage%s" % (filibprefix, filibsuffix) excons.Link(env, filibname, static=static, force=True, silent=True) excons.AddHelpOptions(freeimage=GetOptionsString())
def _RealRequire(env): if boost_inc_dir: env.Append(CPPPATH=boost_inc_dir) if boost_lib_dir: env.Append(LIBPATH=boost_lib_dir) autolinkcount = 0 defs = [] # All libs but Boost.Python are statically linked by default # => use BOOST_PYTHON_STATIC_LIB to enable static linking # Libraries are auto-linked on windows by default # => disable for all libraries using BOOST_ALL_NO_LIB # => disable for a specific lib using BOOST_[libraryname]_NO_LIB for lib in libs: incdir = libargs[lib]["incdir"] libdir = libargs[lib]["libdir"] libname = libargs[lib]["name"] libstatic = libargs[lib]["static"] autolinklib = libargs[lib]["autolink"] if incdir: env.Append(CPPPATH=[incdir]) if libdir: env.Append(LIBPATH=[libdir]) if sys.platform == "win32": if not autolinklib: defs.append("BOOST_%s_NO_LIB" % lib.upper()) else: autolinkcount += 1 if libstatic: if lib == "thread": # Not to confure with the 'LIB' meaning of BOOST_xxx_NO_LIB defs.append("BOOST_THREAD_USE_LIB") elif lib == "python": # Boost.Python is dynamically linked by 'default' defs.append("BOOST_PYTHON_STATIC_LIB") else: # Should not have to make a special case of Boost.Thread anymore, but # for backward compatibility sake if lib == "thread": defs.append("BOOST_THREAD_USE_DLL") elif lib != "python": defs.append("BOOST_%s_DYN_LINK" % lib.upper()) if not autolinklib: excons.Link(env, libname, static=libstatic, force=True, silent=True) if sys.platform == "win32" and autolinkcount == 0: defs.append("BOOST_ALL_NO_LIB") env.Append(CPPDEFINES=defs) excons.AddHelpOptions(boost=GetOptionsString())