Beispiel #1
0
def configure(env):
    platform = env["platform"]

    if platform not in supported_platforms:
        raise RuntimeError(
            "This module does not currently support building for this platform"
        )

    env.add_module_version_string("mono")

    from SCons.Script import BoolVariable, PathVariable, Variables, Help

    default_mono_static = platform in ["iphone", "javascript"]
    default_mono_bundles_zlib = platform in ["javascript"]

    envvars = Variables()
    envvars.Add(
        PathVariable(
            "mono_prefix",
            "Path to the Mono installation directory for the target platform and architecture",
            "",
            PathVariable.PathAccept,
        ))
    envvars.Add(
        PathVariable(
            "mono_bcl",
            "Path to a custom Mono BCL (Base Class Library) directory for the target platform",
            "",
            PathVariable.PathAccept,
        ))
    envvars.Add(
        BoolVariable("mono_static", "Statically link Mono",
                     default_mono_static))
    envvars.Add(
        BoolVariable("mono_glue", "Build with the Mono glue sources", True))
    envvars.Add(BoolVariable("build_cil", "Build C# solutions", True))
    envvars.Add(
        BoolVariable(
            "copy_mono_root",
            "Make a copy of the Mono installation directory to bundle with the editor",
            True))

    # TODO: It would be great if this could be detected automatically instead
    envvars.Add(
        BoolVariable(
            "mono_bundles_zlib",
            "Specify if the Mono runtime was built with bundled zlib",
            default_mono_bundles_zlib))

    envvars.Update(env)
    Help(envvars.GenerateHelpText(env))

    if env["mono_bundles_zlib"]:
        # Mono may come with zlib bundled for WASM or on newer version when built with MinGW.
        print(
            "This Mono runtime comes with zlib bundled. Disabling 'builtin_zlib'..."
        )
        env["builtin_zlib"] = False
        thirdparty_zlib_dir = "#thirdparty/zlib/"
        env.Prepend(CPPPATH=[thirdparty_zlib_dir])
def configure(env):
    platform = env['platform']

    if platform not in supported_platforms:
        raise RuntimeError(
            'This module does not currently support building for this platform'
        )

    env.use_ptrcall = True
    env.add_module_version_string('mono')

    from SCons.Script import BoolVariable, PathVariable, Variables, Help

    default_mono_static = platform in ['iphone', 'javascript']
    default_mono_bundles_zlib = platform in ['javascript']

    envvars = Variables()
    envvars.Add(
        PathVariable(
            'mono_prefix',
            'Path to the mono installation directory for the target platform and architecture',
            '', PathVariable.PathAccept))
    envvars.Add(
        BoolVariable('mono_static', 'Statically link mono',
                     default_mono_static))
    envvars.Add(
        BoolVariable('mono_glue', 'Build with the mono glue sources', True))
    envvars.Add(
        BoolVariable(
            'copy_mono_root',
            'Make a copy of the mono installation directory to bundle with the editor',
            False))
    envvars.Add(
        BoolVariable('xbuild_fallback',
                     'If MSBuild is not found, fallback to xbuild', False))

    # TODO: It would be great if this could be detected automatically instead
    envvars.Add(
        BoolVariable(
            'mono_bundles_zlib',
            'Specify if the Mono runtime was built with bundled zlib',
            default_mono_bundles_zlib))

    envvars.Update(env)
    Help(envvars.GenerateHelpText(env))

    if env['mono_bundles_zlib']:
        # Mono may come with zlib bundled for WASM or on newer version when built with MinGW.
        print(
            'This Mono runtime comes with zlib bundled. Disabling \'builtin_zlib\'...'
        )
        env['builtin_zlib'] = False
        thirdparty_zlib_dir = "#thirdparty/zlib/"
        env.Prepend(CPPPATH=[thirdparty_zlib_dir])
Beispiel #3
0
def configure(env):
    from SCons.Script import Variables, BoolVariable, Help

    opts = Variables()
    opts.Add(
        BoolVariable(
            "anl_use_long_period",
            "Use a long-period hash for noise (>256) to avoid having repeated patterns "
            "in exchange of a slight decrease in performance.", False))

    opts.Add(
        BoolVariable(
            'anl_use_expressions_camelcase',
            "Use 'camelCase' by default over the 'snake_case' for noise expressions.",
            False))
    opts.Update(env)
    Help(opts.GenerateHelpText(env))
Beispiel #4
0
def configure(env):
    if env["platform"] not in [
            "windows", "osx", "linuxbsd", "server", "android", "haiku",
            "javascript"
    ]:
        raise RuntimeError(
            "This module does not currently support building for this platform"
        )

    env.use_ptrcall = True
    env.add_module_version_string("mono")

    from SCons.Script import BoolVariable, PathVariable, Variables, Help

    envvars = Variables()
    envvars.Add(
        PathVariable(
            "mono_prefix",
            "Path to the mono installation directory for the target platform and architecture",
            "",
            PathVariable.PathAccept,
        ))
    envvars.Add(BoolVariable("mono_static", "Statically link mono", False))
    envvars.Add(
        BoolVariable("mono_glue", "Build with the mono glue sources", True))
    envvars.Add(
        BoolVariable(
            "copy_mono_root",
            "Make a copy of the mono installation directory to bundle with the editor",
            False))
    envvars.Add(
        BoolVariable("xbuild_fallback",
                     "If MSBuild is not found, fallback to xbuild", False))
    envvars.Update(env)
    Help(envvars.GenerateHelpText(env))

    if env["platform"] == "javascript":
        # Mono wasm already has zlib builtin, so we need this workaround to avoid symbol collisions
        print("Compiling with Mono wasm disables 'builtin_zlib'")
        env["builtin_zlib"] = False
        thirdparty_zlib_dir = "#thirdparty/zlib/"
        env.Prepend(CPPPATH=[thirdparty_zlib_dir])
Beispiel #5
0
def configure(env):
    from SCons.Script import Variables, Help

    opts = Variables()

    opts.Add("geomtools_scale_factor", 
        "The precision used for converting between integer and float coordinates throughout " +
        "poly backends implementations for computational robustness purposes.", "1e5")

    opts.Update(env)
    
    def help_format(env, opt, help, default, actual, aliases):
        if opt == "geomtools_scale_factor":
            fmt = "\n%s: %s.\n    default: %s (based on CMP_EPSILON)\n    actual: %s\n"
        else:
            fmt = "\n%s: %s.\n    default: %s\n    actual: %s\n"
        return fmt % (opt, help, default, actual)
    
    opts.FormatVariableHelpText = help_format
    Help(opts.GenerateHelpText(env))
Beispiel #6
0
def configure(env):
    if env['platform'] not in [
            'windows', 'osx', 'linuxbsd', 'server', 'android', 'haiku',
            'javascript'
    ]:
        raise RuntimeError(
            'This module does not currently support building for this platform'
        )

    env.use_ptrcall = True
    env.add_module_version_string('mono')

    from SCons.Script import BoolVariable, PathVariable, Variables, Help

    envvars = Variables()
    envvars.Add(
        PathVariable(
            'mono_prefix',
            'Path to the mono installation directory for the target platform and architecture',
            '', PathVariable.PathAccept))
    envvars.Add(BoolVariable('mono_static', 'Statically link mono', False))
    envvars.Add(
        BoolVariable('mono_glue', 'Build with the mono glue sources', True))
    envvars.Add(
        BoolVariable(
            'copy_mono_root',
            'Make a copy of the mono installation directory to bundle with the editor',
            False))
    envvars.Add(
        BoolVariable('xbuild_fallback',
                     'If MSBuild is not found, fallback to xbuild', False))
    envvars.Update(env)
    Help(envvars.GenerateHelpText(env))

    if env['platform'] == 'javascript':
        # Mono wasm already has zlib builtin, so we need this workaround to avoid symbol collisions
        print('Compiling with Mono wasm disables \'builtin_zlib\'')
        env['builtin_zlib'] = False
        thirdparty_zlib_dir = "#thirdparty/zlib/"
        env.Prepend(CPPPATH=[thirdparty_zlib_dir])
Beispiel #7
0
def configure(env):
    from SCons.Script import Variables, BoolVariable, Help, Exit
    import goost

    opts = Variables()
    for name in goost.get_components():
        opts.Add(
            BoolVariable("goost_%s_enabled" % (name),
                         "Build %s component." % (name), True))

    opts.Add(
        "goost_scale_factor",
        "The precision used for converting between integer and float coordinates.",
        "1e5")

    opts.Update(env)

    # Get a list of components which got disabled.
    disabled = []
    for name in goost.get_components():
        if not env["goost_%s_enabled" % (name)]:
            disabled.append(name)

    # Implicitly disable child components.
    for name in disabled:
        children = goost.get_child_components(name)
        for child_name in children:
            print("Goost: disabling `%s` component (%s)." % (child_name, name))
            env["goost_%s_enabled" % (child_name)] = False

    def help_format(env, opt, help, default, actual, aliases):
        if opt == "goost_scale_factor":
            fmt = "\n%s: %s.\n    default: %s (based on CMP_EPSILON)\n    actual: %s\n"
        else:
            fmt = "\n%s: %s.\n    default: %s\n    actual: %s\n"
        return fmt % (opt, help, default, actual)

    opts.FormatVariableHelpText = help_format
    Help(opts.GenerateHelpText(env))
Beispiel #8
0
 def __add_build_vars(env, build_type_names):
     """
     Return Variables instance.
     """
     assert isinstance(env, Environment)
     vs = Variables(None, ARGUMENTS)
     vs.Add(
         ListVariable(key='build',
                      help=buildtype.help_msg(build_type_names),
                      default=buildtype.default(build_type_names),
                      names=build_type_names,
                      map={}))
     vs.Add(
         EnumVariable(key='stage',
                      help='build stage',
                      default='compile',
                      allowed_values=('compile', 'link'),
                      map={},
                      ignorecase=0))
     vs.Update(env)
     Help(vs.GenerateHelpText(env))
     pass
Beispiel #9
0
def configure(env):
    from SCons.Script import Variables, BoolVariable, Help

    opts = Variables()

    # Config.
    components_config = {}
    components_enabled_by_default = True
    classes_config = {}
    classes_enabled_by_default = True

    # From `custom.py` file.
    try:
        import custom
        if hasattr(custom, "components"):
            components_config = custom.components
        if hasattr(custom, "components_enabled_by_default"):
            components_enabled_by_default = custom.components_enabled_by_default
        if hasattr(custom, "classes"):
            classes_config = custom.classes
        if hasattr(custom, "classes_enabled_by_default"):
            classes_enabled_by_default = custom.classes_enabled_by_default
    except ImportError:
        pass

    # From command-line (CLI arguments override arguments specified via file).
    opts.Add(
        BoolVariable(
            "goost_components_enabled",
            "Set to `no` to disable all components by default, and enable each component of interest manually",
            True))

    # Get a list of all components and add them, regardless of configuration.
    for name in goost.get_components()["enabled"]:  # All enabled by default.
        opts.Add(
            BoolVariable("goost_%s_enabled" % (name),
                         "Build %s component." % (name), True))

    # Math/Geometry.
    opts.Add(
        "goost_scale_factor",
        "The precision used for converting between integer and float coordinates.",
        "1e5")

    def help_format(env, opt, help, default, actual, aliases):
        if opt == "goost_scale_factor":
            fmt = "\n%s: %s.\n    default: %s (based on CMP_EPSILON)\n    actual: %s\n"
        else:
            fmt = "\n%s: %s.\n    default: %s\n    actual: %s\n"
        return fmt % (opt, help, default, actual)

    opts.FormatVariableHelpText = help_format

    # Must update environment to override `components_config` from CLI/file.
    # Do not call this method afterwards as the environment is going to be
    # updated manually. If you need to add more options not related to
    # components/classes, add them above.
    opts.Update(env)

    components = configure_components(env, components_config,
                                      components_enabled_by_default)
    classes = configure_classes(env, classes_config,
                                classes_enabled_by_default)

    if env["verbose"]:
        for class_name in classes["enabled"]:
            # Report rightmost child components only.
            for component_name in reversed(
                    goost.get_class_components(class_name)):
                skip = False
                if component_name in components["disabled"]:
                    print(
                        "Goost: Skipping class `%s`, because component `%s` is disabled."
                        % (class_name, component_name))
                    skip = True
                if skip:
                    break

    # Generate help text.
    Help(opts.GenerateHelpText(env))