def setup(ctx):
    env = ctx.env

    cc, linker, lib, vc_paths, msvc_version_info = _detect_msvc(ctx)
    ctx.env["PATH"] = vc_paths["PATH"][:]
    ctx.env.prextend("CPPPATH", vc_paths["INCLUDE"], create=True)
    ctx.env.prextend("LIBDIR", vc_paths["LIB"], create=True)

    ctx.env["CC"] = [cc]
    ctx.env["CC_TGT_F"] = ["/c", "/Fo"]
    ctx.env["CC_SRC_F"] = []
    ctx.env["CFLAGS"] = ["/nologo"]
    ctx.env["CPPPATH_FMT"] = "/I%s"
    ctx.env["DEFINES"] = []
    ctx.env["DEFINES_FMT"] = "/D%s"
    ctx.env["LINK"] = [linker]
    ctx.env["LINK_TGT_F"] = ["/out:"]
    ctx.env["LINK_SRC_F"] = []
    ctx.env["LINKFLAGS"] = ["/nologo"]
    ctx.env["SHLINK"] = [linker, "/DLL"]
    ctx.env["SHLINK_TGT_F"] = ["/out:"]
    ctx.env["SHLINK_SRC_F"] = []
    ctx.env["SHLINKFLAGS"] = []
    ctx.env["MODLINK"] = [linker, "/DLL"]
    ctx.env["MODLINK_TGT_F"] = ["/out:"]
    ctx.env["MODLINK_SRC_F"] = []
    ctx.env["MODLINKFLAGS"] = ["/nologo"]
    ctx.env["LIBS"] = []
    ctx.env["LIB_FMT"] = "%s.lib"
    ctx.env["LIBDIR"] = []
    ctx.env["LIBDIR_FMT"] = "/LIBPATH:%s"

    ctx.env["STLINK"] = [lib]
    ctx.env["STLINK_TGT_F"] = ["/OUT:"]
    ctx.env["STLINK_SRC_F"] = []
    ctx.env["STLINKFLAGS"] = ["/nologo"]
    ctx.env["STATICLIB_FMT"] = "%s.lib"

    ctx.env["CXX"] = [cc]
    ctx.env["CXX_TGT_F"] = ["/c", "/Fo"]
    ctx.env["CXX_SRC_F"] = []
    ctx.env["CXXFLAGS"] = ["/nologo"]
    if msvc_version_info >= (9, 0):
        ctx.env.append("CXXFLAGS", "/EHsc")
    ctx.env["CXXLINK"] = [linker]
    ctx.env["CXXLINKFLAGS"] = ["/nologo"]
    ctx.env["CXXLINK_TGT_F"] = ["/out:"]
    ctx.env["CXXLINK_SRC_F"] = []
    ctx.env["CXXSHLINK"] = [linker]
    ctx.env["CXXSHLINKFLAGS"] = []
    ctx.env["CXXSHLINK_TGT_F"] = ["/out:"]
    ctx.env["CXXSHLINK_SRC_F"] = []

    ctx.env["CC_OBJECT_FMT"] = "%s.obj"
    ctx.env["CXX_OBJECT_FMT"] = "%s.obj"
    ctx.env["SHAREDLIB_FMT"] = "%s.dll"
    ctx.env["PROGRAM_FMT"] = "%s.exe"

    for k, v in vc_paths.items():
        k = k.encode("ascii")
        if k in ["LIB"]:
            env.extend("LIBDIR", v, create=True)
        elif k in ["CPPPATH"]:
            env.extend(k, v, create=True)
dataset/ETHPy150Open cournape/Bento/bento/private/_yaku/yaku/tools/msvc.py/setup/original