Пример #1
0
def build(ctx):
    ocaml = fbuild.builders.ocaml.batteries.Ocaml(ctx)

    lib = ocaml.ocamlc.build_lib('lib',
                                 Path.glob('lib*.ml{,i}'),
                                 packages=['sexplib.syntax'])
    print('here', lib)
    exe = ocaml.ocamlc.build_exe('exe.byte', ['exe.ml'], libs=[lib])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    lib = ocaml.ocamlopt.build_lib('lib',
                                   Path.glob('lib*.ml{,i}'),
                                   packages=['sexplib.syntax'])
    exe = ocaml.ocamlopt.build_exe('exe.byte', ['exe.ml'], libs=[lib])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    # We can also build bytecode and native libraries at the same time.
    lib = ocaml.build_lib('lib',
                          Path.glob('lib*.ml{,i}'),
                          packages=['sexplib.syntax'])
    exe = ocaml.build_exe('exe', ['exe.ml'], libs=[lib]).bytecode
Пример #2
0
def test(ctx):
    """Run the felix tests and other commands."""

    # Make sure we're built.
    phases, iscr, felix = build(ctx)

    from buildsystem.flx import test_flx

    failed_srcs = []

    def test(src):
        try:
            passed = test_flx(phases.target, felix, src)
        except fbuild.ConfigFailed as e:
            ctx.logger.log(str(e))
            passed = False
        return src, passed

    # Run the dynamic loading tests first
    try:
        lib1 = felix.compile('test/regress/drt/lib1.flx', static=False)
        lib2 = felix.compile('test/regress/drt/lib2.flx', static=False)
    except fbuild.ExecutionError as e:
        ctx.logger.log(e, verbose=1)
    else:
        if not test_flx(phases.target, felix, 'test/regress/drt/main1.flx',
                env={'lib1': lib1, 'lib2': lib2}):
            failed_srcs.append('test/regress/drt/main1.flx')

    srcs = Path.globall(
        'test/*/*.flx',
        'test/*/*/*.flx',
        'tut/*/*.flx',
        exclude=[
            'test/drivers/*.flx',
            'test/faio/posix-*.flx',
            'test/faio/win-*.flx',
            'test/regress/drt/*.flx',
            'test/regress/bt/*.flx',
            'test/regress/kf/*.flx',
            'test/regress/nd/*.flx',
            'test/test-data/*.flx',
        ])

    if 'posix' in phases.target.platform:
        srcs.extend(Path.glob('test/faio/posix-*.flx'))

    if 'windows' in phases.target.platform:
        srcs.extend(Path.glob('test/faio/win-*.flx'))

    for src, passed in phases.target.ctx.scheduler.map(
            test,
            sorted(srcs, reverse=True)):
        if not passed:
            failed_srcs.append(src)

    if failed_srcs:
        ctx.logger.log('\nThe following tests failed:')
        for src in failed_srcs:
            ctx.logger.log('  %s' % src, color='yellow')
Пример #3
0
def build(ctx):
    rec = configure(ctx)
    src = rec.dasm.translate('src/x86_64.dasc', 'codegen.c')
    rejit = rec.c.build_lib('rejit', Path.glob('src/*.c') + Path.glob('utf/*.c'),
        includes=['.', ctx.buildroot])
    rec.c.build_exe('bench', ['bench.c'], libs=[rejit])
    rec.c.build_exe('ex', ['ex.c'], libs=[rejit])
    if rec.tests:
        rec.c.build_exe('tst', ['tst.c'], cflags=rec.testflags, libs=[rejit])
Пример #4
0
def build(phase, felix):
    print ("BUILDING PLUGINS")
    for f in Path.glob('src/lib/plugins/*'):
      copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / 'share'/f[4:]) 
    plugins = [
      #"ocaml2html",
      #"py2html",
      #"fdoc2html",
      #"flx2html",
      #"cpp2html",
      #"fpc2html",
      #"fdoc_slideshow",
      #"fdoc_paragraph",
      #"fdoc_heading",
      #"fdoc_fileseq",
      #"fdoc_scanner",
      #"fdoc_button",
      "toolchain_clang_osx",
      "toolchain_clang_linux",
      "toolchain_gcc_osx",
      "toolchain_gcc_linux",
      "toolchain_gcc48_linux",
      ]
    for base in plugins:
      shlib = felix.compile(phase.ctx.buildroot/('share/lib/plugins/'+base+'.flx'),flags=['-od',phase.ctx.buildroot/'host/lib/rtl'])
Пример #5
0
def build_flx_core(phase):
    path = Path('src/compiler/flx_core')
    return phase.ocaml.build_lib(path / 'flx_core',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[build_flx_misc(phase)],
        external_libs=['nums'],
        packages=['batteries'])
Пример #6
0
def build(ctx):
    ctx.install_destdir = ctx.options.destdir
    ctx.install_prefix = ctx.options.prefix

    rec = configure(ctx)

    gl3w = build_gl3w(ctx, rec.c)
    abseil = build_abseil(ctx, rec.cxx)
    fmt = build_fmtlib(ctx, rec.cxx)
    tsm = build_libtsm(ctx, rec.c, rec.xkbcommon)
    skia = build_skia(ctx, rec.platform, rec.cxx, rec.freetype, rec.fontconfig)

    macros = []
    if rec.xkbcommon is None:
        macros.append('USE_LIBTSM_XKBCOMMON')

    uterm = rec.cxx.build_exe(
        'uterm',
        Path.glob('src/*.cc'),
        includes=abseil.includes + gl3w.includes + skia.includes +
        fmt.includes + tsm.includes + ['deps/utfcpp/source', 'deps/sparsepp'],
        libs=[
            abseil.base, abseil.strings, abseil.stacktrace, gl3w.lib, skia.lib,
            fmt.lib, tsm.lib
        ],
        macros=macros,
        external_libs=['dl', 'pthread'],
        cflags=rec.glfw.cflags + rec.egl.cflags + rec.confuse.cflags,
        ldlibs=rec.glfw.ldlibs + rec.egl.ldlibs + rec.confuse.ldlibs +
        skia.ldlibs + (rec.libprofiler and rec.libprofiler.ldlibs or []))

    ctx.install(uterm, 'bin')
Пример #7
0
def build_flx_drivers(phase):
    path = Path('src/compiler/drivers')

    call('buildsystem.ocs.build_exe', phase)

    lib = phase.ocaml.build_lib(path / 'flx_driver',
        srcs=Path.glob(path / '*.ml{,i}'))

    return {
        'flxi': phase.ocaml.build_exe('bin/flxi',
            srcs=Path(path / 'flxi' / '*.ml{,i}').glob(),
            libs=[
                call('buildsystem.dypgen.build_lib', phase),
                call('buildsystem.ocs.build_lib', phase),
                lib,
                build_flx_misc(phase),
                build_flx_core(phase),
                build_flx_parse(phase),
                build_flx_bind(phase),
                build_flx_codegen(phase)],
            external_libs=[
                'batteries',
                'threads',
                'llvm',
                'llvm_analysis',
                'llvm_executionengine',
                'llvm_scalar_opts',
                'llvm_target'],
            flags=['-thread'],
            packages=['batteries'],
            cc=phase.cxx.static.compiler.gcc.exe) }
Пример #8
0
def build_flx_frontend(phase):
    path = Path('src/compiler/flx_frontend')
    return phase.ocaml.build_lib(path / 'flx_frontend',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[
            build_flx_misc(phase),
            build_flx_core(phase)])
Пример #9
0
def build_lib(phase):
    path = Path('src/compiler/dypgen/dyplib')

    # dyplib cannot be built with ocamlcp.
    ocaml = phase.ocamlc if phase.ocaml == phase.ocamlcp else phase.ocaml

    return ocaml.build_lib(path/'dyp', Path.glob(path/'*.ml{,i}'))
Пример #10
0
def build(phase, felix):
    print("BUILDING PLUGINS")
    for f in Path.glob('src/lib/plugins/*'):
        copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / 'share' / f[4:])
    plugins = [
        #"ocaml2html",
        #"py2html",
        #"fdoc2html",
        #"flx2html",
        #"cpp2html",
        #"fpc2html",
        #"fdoc_slideshow",
        #"fdoc_paragraph",
        #"fdoc_heading",
        #"fdoc_fileseq",
        #"fdoc_scanner",
        #"fdoc_button",
        "toolchain_clang_osx",
        "toolchain_clang_linux",
        "toolchain_gcc_osx",
        "toolchain_gcc_linux",
    ]
    for base in plugins:
        shlib = felix.compile(
            phase.ctx.buildroot / ('share/lib/plugins/' + base + '.flx'),
            flags=['-od', phase.ctx.buildroot / 'host/lib/rtl'])
Пример #11
0
def build_flx_drivers(ctx, phase):
    libs = [
        call('buildsystem.ocs.build_lib', phase),
        call('buildsystem.sex.build', phase),
        call('buildsystem.dypgen.build_lib', phase),
        build_flx_version(phase),
        build_flx_lex(phase),
        build_flx_parse(phase),
        build_flx_misc(phase),
        build_flx_file(phase),
        build_flx_core(phase),
        build_flx_desugar(phase),
        build_flx_bind(phase),
        build_flx_frontend(phase),
        build_flx_opt(phase),
        build_flx_lower(phase),
        build_flx_backend(phase),
        build_flx_cpp_backend(phase),
        build_flx_version_hook(phase),
    ]

    external_libs = ['unix', 'str']

    flxg = phase.ocaml.build_exe('host/bin/flxg',
                                 Path.glob('src/compiler/flxg/*.ml{,i}'),
                                 libs=libs,
                                 external_libs=external_libs)

    return Record(flxg=flxg, )
Пример #12
0
def build_libtsm(ctx, c, xkbcommon):
    base = Path('deps/libtsm')
    src = base / 'src'
    shl = src / 'shared'
    tsm = src / 'tsm'

    sources = Path.glob(
        tsm / '*.c') + [shl / 'shl-htable.c', base / 'external' / 'wcwidth.c']
    includes = [shl, tsm, base]

    if xkbcommon is not None:
        cflags = xkbcommon.cflags
    else:
        cflags = []

    macros = ['_GNU_SOURCE=1']
    if not ctx.options.release:
        macros.append('BUILD_ENABLE_DEBUG')

    return Record(includes=includes,
                  lib=c.build_lib('tsm',
                                  sources,
                                  includes=includes,
                                  macros=macros,
                                  cflags=cflags))
Пример #13
0
def build_flx_drivers(ctx, phase):
    libs = [
        call('buildsystem.ocs.build_lib', phase),
        call('buildsystem.sex.build', phase),
        call('buildsystem.dypgen.build_lib', phase),
        build_flx_version(phase),
        build_flx_lex(phase),
        build_flx_parse(phase),
        build_flx_misc(phase),
        build_flx_file(phase),
        build_flx_core(phase),
        build_flx_desugar(phase),
        build_flx_bind(phase),
        build_flx_frontend(phase),
        build_flx_opt(phase),
        build_flx_lower(phase),
        build_flx_backend(phase),
        build_flx_cpp_backend(phase),
        build_flx_version_hook(phase),
        ]

    external_libs = ['nums', 'unix', 'str']

    flxg = phase.ocaml.build_exe('host/bin/flxg',
        Path.glob('src/compiler/flxg/*.ml{,i}'),
        libs=libs,
        external_libs=external_libs)

    return Record(
        flxg=flxg,
    )
Пример #14
0
def build(ctx):
    rec = configure(ctx)
    static = rec.static
    shared = rec.shared
    libregexp = static.build_lib('regexp9', Path.glob('libregexp/*.c',
                                                      exclude=['*test*.c']))
    static.build_exe('o', ['o.c'], libs=[libregexp])
    static.build_exe('tst', ['o.c'], macros=['UTEST'], libs=[libregexp])
Пример #15
0
def build(ctx):
    rec = configure(ctx)
    static = rec.static
    shared = rec.shared
    libregexp = static.build_lib(
        'regexp9', Path.glob('libregexp/*.c', exclude=['*test*.c']))
    static.build_exe('o', ['o.c'], libs=[libregexp])
    static.build_exe('tst', ['o.c'], macros=['UTEST'], libs=[libregexp])
Пример #16
0
def build_midifi(ctx, rec, midifile):
    all_sources = []
    for pat in 'midifi/*.flx', 'sfml/sfml/*.flx', 'midifile-flx/midifile.flx':
        all_sources.extend(Path.glob(pat))

    rec.felix.compile('midifi', 'midifi.flx', all_sources, rec.static,
                      includes=['sfml', 'midifile', 'midifile-flx'],
                      pkgconfig_paths=['build/config'], libs=[midifile])
Пример #17
0
def build_runtime(host_phase, target_phase):
    path = Path('src', 'rtl')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_rtl.hpp',
        path / 'flx_rtl_shapes.hpp',
        path / 'flx_compiler_support_headers.hpp',
        path / 'flx_compiler_support_bodies.hpp',
        path / 'flx_dynlink.hpp',
        path / 'flx_i18n.hpp',
        path / 'flx_ioutil.hpp',
        path / 'flx_strutil.hpp',
        path / 'flx_executil.hpp',
        path / 'flx_sync.hpp',
        path / 'flx_world.hpp',
        path / 'flx_async_world.hpp',
        path / 'flx_world_config.hpp',
        path / 'plat_linux.hpp',
    )

    for f in Path.glob(path/"*.hpp"):
      print("Copying " + f + " --> " +target_phase.ctx.buildroot/f )
      copy(ctx=target_phase.ctx, src=f,dst=target_phase.ctx.buildroot/f)

    srcs = [copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f) for f in Path.glob(path / '*.cpp')]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl'
    ]
    macros = ['BUILD_RTL']
    libs = [
        call('buildsystem.flx_async.build_runtime', host_phase,target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase, target_phase),
    ]

    dlfcn_h = config_call('fbuild.config.c.posix.dlfcn_h',
        target_phase.platform,
        target_phase.cxx.static,
        target_phase.cxx.shared)

    if dlfcn_h.dlopen:
        external_libs = dlfcn_h.external_libs
    else:
        external_libs = []

    dst = 'host/lib/rtl/flx'
    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs],
            external_libs=external_libs),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs],
            external_libs=external_libs))
Пример #18
0
def build_flx_bind(phase):
    path = Path('src', 'compiler', 'flx_bind')
    return phase.ocaml.build_lib(path / 'flx_bind',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[
            build_flx_misc(phase),
            build_flx_core(phase),
            build_flx_parse(phase)],
        packages=['batteries'])
Пример #19
0
def build_flx_bind(phase):
    path = Path('src/compiler/flx_bind')
    return phase.ocaml.build_lib(path / 'flx_bind',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[
            build_flx_misc(phase),
            build_flx_core(phase),
            build_flx_desugar(phase)],
        external_libs=['nums'])
Пример #20
0
def build_flx_codegen(phase):
    path = Path('src', 'compiler', 'flx_codegen')
    return phase.ocaml.build_lib(path / 'flx_codegen',
        srcs=Path.glob(path / '*.ml{,i}'),
        includes=[phase.llvm_config.ocaml_libdir()],
        libs=[
            build_flx_misc(phase),
            build_flx_core(phase)],
        packages=['batteries'])
Пример #21
0
def build_flx_core(phase):
    path = Path('src/compiler/flx_core')
    return phase.ocaml.build_lib(path / 'flx_core',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[
            build_flx_misc(phase),
            call('buildsystem.dypgen.build_lib', phase),
            call('buildsystem.ocs.build_lib', phase)],
        external_libs=['nums'])
Пример #22
0
def build_flx_backend(phase):
    path = Path('src/compiler/flx_backend')
    return phase.ocaml.build_lib(path / 'flx_backend',
                                 srcs=Path.glob(path / '*.ml{,i}'),
                                 libs=[
                                     build_flx_lex(phase),
                                     build_flx_misc(phase),
                                     build_flx_core(phase)
                                 ])
Пример #23
0
def build_midifile(ctx, rec):
    if isinstance(rec.shared, MsvcBuilder):
        builder = rec.shared
        lflags = ['/DEBUG'] if not ctx.options.release else []
    else:
        builder = rec.static
        lflags = []
    return builder.build_lib('midifile',
        Path.glob('midifile/src-library/*.cpp'), includes=['midifile/include'],
        lflags=lflags)
Пример #24
0
def build_runtime(host_phase, target_phase):
    path = Path('src', 'rtl')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        target_phase.ctx.buildroot / 'config/target/flx_rtl_config.hpp',
        target_phase.ctx.buildroot / 'config/target/flx_meta.hpp',
        path / 'flx_rtl.hpp',
        path / 'flx_compiler_support_headers.hpp',
        path / 'flx_compiler_support_bodies.hpp',
        path / 'flx_dynlink.hpp',
        path / 'flx_i18n.hpp',
        path / 'flx_ioutil.hpp',
        path / 'flx_strutil.hpp',
        path / 'flx_executil.hpp',
    )

    dst = 'lib/rtl/flx'
    srcs = Path.glob(path / '*.cpp')
    includes = [
        target_phase.ctx.buildroot / 'config/target',
        'src/exceptions',
        'src/demux',
        'src/faio',
        'src/judy/src',
        'src/gc',
        'src/pthread',
    ]
    macros = ['BUILD_RTL']
    libs = [
        call('buildsystem.flx_async.build_runtime', target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase, target_phase),
    ]

    dlfcn_h = config_call('fbuild.config.c.posix.dlfcn_h',
        target_phase.platform,
        target_phase.cxx.static,
        target_phase.cxx.shared)

    if dlfcn_h.dlopen:
        external_libs = dlfcn_h.external_libs
    else:
        external_libs = []

    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs],
            external_libs=external_libs),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs],
            external_libs=external_libs))
Пример #25
0
def build_flx_bind(phase):
    path = Path('src/compiler/flx_bind')
    return phase.ocaml.build_lib(path / 'flx_bind',
                                 srcs=Path.glob(path / '*.ml{,i}'),
                                 libs=[
                                     build_flx_lex(phase),
                                     build_flx_misc(phase),
                                     build_flx_core(phase),
                                     build_flx_desugar(phase)
                                 ],
                                 external_libs=[])
Пример #26
0
def build(ctx):
    ocaml = fbuild.builders.ocaml.ocamlfind.Ocaml(ctx,
        packages=['unix'])

    libb = ocaml.ocamlc.build_lib('libb', Path.glob('b*.ml{,i}'),
        packages=['num'])
    liba = ocaml.ocamlc.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe  = ocaml.ocamlc.build_exe('exe.byte', ['exe.ml'],
        libs=[libb, liba],
        packages=['num'])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    libb = ocaml.ocamlopt.build_lib('libb', Path.glob('b*.ml{,i}'),
        packages=['num'])
    liba = ocaml.ocamlopt.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe  = ocaml.ocamlopt.build_exe('exe.native', ['exe.ml'],
        libs=[libb, liba],
        packages=['num'])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    # We can also build bytecode and native libraries at the same time.
    libb = ocaml.build_lib('libb', Path.glob('b*.ml{,i}'),
        packages=['num'])
    liba = ocaml.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe  = ocaml.build_exe('exe', ['exe.ml'],
        libs=[libb, liba],
        packages=['num']).bytecode
Пример #27
0
def build(ctx):
    ocaml = fbuild.builders.ocaml.Ocaml(ctx)

    libb = ocaml.ocamlc.build_lib('libb', Path.glob('b*.ml{,i}'))
    liba = ocaml.ocamlc.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe  = ocaml.ocamlc.build_exe('exe.byte', ['exe.ml'], libs=[libb, liba])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    libb = ocaml.ocamlopt.build_lib('libb', Path.glob('b*.ml{,i}'))
    liba = ocaml.ocamlopt.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe  = ocaml.ocamlopt.build_exe('exe.native', ['exe.ml'], libs=[libb, liba])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    # We can also build bytecode and native libraries at the same time.
    libb = ocaml.build_lib('libb', Path.glob('b*.ml{,i}'))
    liba = ocaml.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe  = ocaml.build_exe('exe2', ['exe.ml'], libs=[libb, liba])

    ctx.logger.log(' * running %s:' % exe.bytecode)
    ctx.execute([exe.bytecode])

    ctx.logger.log(' * running %s:' % exe.native)
    ctx.execute([exe.native])

    # We can also use packed files.
    pack = ocaml.ocamlc.build_pack('c', ['c1.ml', 'c2.ml'])
    exe = ocaml.ocamlc.build_exe('exe_packed', ['exe_packed.ml'], objs=[pack])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])
Пример #28
0
def build(ctx):
    ocaml = fbuild.builders.ocaml.ocamlfind.Ocaml(ctx, packages=['unix'])

    libb = ocaml.ocamlc.build_lib('libb',
                                  Path.glob('b*.ml{,i}'),
                                  packages=['num'])
    liba = ocaml.ocamlc.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe = ocaml.ocamlc.build_exe('exe.byte', ['exe.ml'],
                                 libs=[libb, liba],
                                 packages=['num'])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    libb = ocaml.ocamlopt.build_lib('libb',
                                    Path.glob('b*.ml{,i}'),
                                    packages=['num'])
    liba = ocaml.ocamlopt.build_lib('liba',
                                    Path.glob('a*.ml{,i}'),
                                    libs=[libb])
    exe = ocaml.ocamlopt.build_exe('exe.native', ['exe.ml'],
                                   libs=[libb, liba],
                                   packages=['num'])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    # We can also build bytecode and native libraries at the same time.
    libb = ocaml.build_lib('libb', Path.glob('b*.ml{,i}'), packages=['num'])
    liba = ocaml.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe = ocaml.build_exe('exe', ['exe.ml'],
                          libs=[libb, liba],
                          packages=['num']).bytecode
Пример #29
0
def build(ctx):
    ocaml = fbuild.builders.ocaml.batteries.Ocaml(ctx)

    lib = ocaml.ocamlc.build_lib('lib', Path.glob('lib*.ml{,i}'),
        packages=['sexplib.syntax'])
    print('here', lib)
    exe = ocaml.ocamlc.build_exe('exe.byte', ['exe.ml'], libs=[lib])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    lib = ocaml.ocamlopt.build_lib('lib', Path.glob('lib*.ml{,i}'),
        packages=['sexplib.syntax'])
    exe = ocaml.ocamlopt.build_exe('exe.byte', ['exe.ml'], libs=[lib])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    # We can also build bytecode and native libraries at the same time.
    lib = ocaml.build_lib('lib', Path.glob('lib*.ml{,i}'),
        packages=['sexplib.syntax'])
    exe = ocaml.build_exe('exe', ['exe.ml'], libs=[lib]).bytecode
Пример #30
0
def build_flx_core(phase):
    path = Path('src/compiler/flx_core')
    return phase.ocaml.build_lib(path / 'flx_core',
                                 srcs=Path.glob(path / '*.ml{,i}'),
                                 libs=[
                                     call('buildsystem.dypgen.build_lib',
                                          phase),
                                     call('buildsystem.ocs.build_lib', phase),
                                     build_flx_lex(phase),
                                     build_flx_parse(phase),
                                     build_flx_misc(phase),
                                 ],
                                 external_libs=[])
Пример #31
0
def build_flx_desugar(phase):
    path = Path('src/compiler/flx_desugar')

    return phase.ocaml.build_lib(path / 'flx_desugar',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[
            call('buildsystem.dypgen.build_lib', phase),
            call('buildsystem.ocs.build_lib', phase),
            call('buildsystem.sex.build', phase),
            build_flx_misc(phase),
            build_flx_core(phase),
            build_flx_version(phase),
            build_flx_lex(phase),
            build_flx_parse(phase)],
        external_libs=['nums', 'unix'])
Пример #32
0
def build_flx_drivers(ctx, phase):
    libs = [
        call('buildsystem.ocs.build_lib', phase),
        call('buildsystem.sex.build', phase),
        call('buildsystem.dypgen.build_lib', phase),
        build_flx_version(phase),
        build_flx_misc(phase),
        build_flx_core(phase),
        build_flx_lex(phase),
        build_flx_parse(phase),
        build_flx_desugar(phase),
        build_flx_bind(phase),
        build_flx_why(phase),
        build_flx_frontend(phase),
        build_flx_opt(phase),
        build_flx_lower(phase),
        build_flx_backend(phase),
        build_flx_cpp_backend(phase),
        build_flx_version_hook(phase),
        ]

    external_libs = ['nums', 'unix', 'str']

    flxg = phase.ocaml.build_exe('bin/flxg',
        Path.glob('src/compiler/flxg/*.ml{,i}'),
        libs=libs,
        external_libs=external_libs)

    # Don't compile flxc if llvm isn't installed
    if phase.llvm_config:
        flxc = phase.ocaml.build_exe('bin/flxc',
            Path('src/compiler/flxc/*.ml{,i}').glob(),
            includes=[phase.llvm_config.ocaml_libdir()],
            libs=libs + [build_flx_llvm_backend(phase)],
            external_libs=external_libs + [
                'llvm',
                'llvm_analysis',
                'llvm_executionengine',
                'llvm_scalar_opts',
                'llvm_target'],
            cc=phase.cxx.static.compiler.gcc.exe)
    else:
        flxc = None

    return Record(
        flxg=flxg,
        flxc=flxc,
    )
Пример #33
0
def build(ctx):
    rec = configure(ctx)

    gl3w = build_gl3w(ctx, rec.cxx)
    abseil = build_abseil(ctx, rec.cxx)
    skia = build_skia(ctx, rec.cxx)
    fmt = build_fmtlib(ctx, rec.cxx)

    rec.cxx.build_exe('uterm', Path.glob('src/*.cc'),
                      includes=gl3w.includes + skia.includes + fmt.includes + \
                               ['deps/utfcpp/source', 'deps/concurrentqueue'],
                      libs=[abseil.base, abseil.strings, abseil.stacktrace, gl3w.lib,
                            skia.lib, fmt.lib],
                      macros=['UTERM_BLACK_SCREEN_WORKAROUND'],
                      external_libs=['glfw3', 'GL', 'tsm', 'X11', 'dl', 'pthread', 'profiler'],
                      cflags=['-I/home/ryan/stuff/glfw/install/include'],
                      lflags=['-fuse-ld=lld', '-L/home/ryan/stuff/glfw/install/lib'])
Пример #34
0
def build_flx_desugar(phase):
    path = Path('src/compiler/flx_desugar')

    return phase.ocaml.build_lib(path / 'flx_desugar',
                                 srcs=Path.glob(path / '*.ml{,i}'),
                                 libs=[
                                     call('buildsystem.dypgen.build_lib',
                                          phase),
                                     call('buildsystem.ocs.build_lib', phase),
                                     call('buildsystem.sex.build', phase),
                                     build_flx_lex(phase),
                                     build_flx_parse(phase),
                                     build_flx_file(phase),
                                     build_flx_misc(phase),
                                     build_flx_core(phase),
                                     build_flx_version(phase),
                                 ],
                                 external_libs=['unix'])
Пример #35
0
def build(ctx):
    rec = configure(ctx)
    ctx.install_destdir = ctx.options.destdir
    ctx.install_prefix = ctx.options.prefix

    dtweaks = rec.c.build_exe('dtweaks', ['src/dtweaks.c'],
                              cflags=rec.glib.cflags + rec.gio.cflags,
                              ldlibs=rec.glib.ldlibs + rec.gio.ldlibs)

    ctx.install(dtweaks, 'bin')
    ctx.install('misc/dtweaks.hook', 'share/libalpm/hooks')

    if rec.mrkd is not None:
        roff = []
        for man in Path.glob('man/*.md'):
            roff = rec.mrkd.convert(man, format='roff')
            rec.mrkd.convert(man, format='html', index='man/index.ini')
            ctx.install(roff, 'share/man/man%s' % roff.ext[1:])

    return Record(dtweaks=dtweaks, **rec)
Пример #36
0
def build(ctx):
    rec = configure(ctx)
    flex = rec.flex
    bison = rec.bison
    c = rec.c
    pthread = rec.pthread
    cflags = rec.cflags
    ldlibs = rec.ldlibs

    lex, hdr = flex('src/lex.l', 'lex.h')
    yacc = bison('src/parse.y', defines=True)
    c.build_exe('tst', ['tst.c', lex, yacc]+Path.glob('src/*.c'),
        cflags=cflags, includes=['src', hdr.parent], ldlibs=ldlibs)

    lightbuild_opts = {}
    if pthread.header:
        lightbuild_opts['macros'] = ['HAVE_PTHREAD_H=1']
        lightbuild_opts['external_libs'] = pthread.external_libs
    c.build_exe('lightbuild', ['lightbuild/lightbuild.c'], ldlibs=ldlibs,
                **lightbuild_opts)
Пример #37
0
def build(ctx):
    rec = configure(ctx)
    flex = rec.flex
    bison = rec.bison
    c = rec.c
    pthread = rec.pthread
    cflags = rec.cflags
    ldlibs = rec.ldlibs

    lex, hdr = flex('src/lex.l', 'lex.h')
    yacc = bison('src/parse.y', defines=True)
    c.build_exe('tst', ['tst.c', lex, yacc] + Path.glob('src/*.c'),
                cflags=cflags,
                includes=['src', hdr.parent],
                ldlibs=ldlibs)

    lightbuild_opts = {}
    if pthread.header:
        lightbuild_opts['macros'] = ['HAVE_PTHREAD_H=1']
        lightbuild_opts['external_libs'] = pthread.external_libs
    c.build_exe('lightbuild', ['lightbuild/lightbuild.c'],
                ldlibs=ldlibs,
                **lightbuild_opts)
Пример #38
0
def build_runtime(host_phase, target_phase):
    path = Path("src/gc")

    buildsystem.copy_hpps_to_rtl(
        target_phase.ctx,
        target_phase.ctx.buildroot / "config/target/flx_gc_config.hpp",
        path / "flx_gc.hpp",
        path / "flx_judy_scanner.hpp",
        path / "flx_collector.hpp",
        path / "flx_gc_private.hpp",
        path / "flx_ts_collector.hpp",
    )

    dst = "lib/rtl/flx_gc"
    srcs = Path.glob(path / "*.cpp")
    includes = [
        target_phase.ctx.buildroot / "config/target",
        "src/rtl",
        "src/pthread",
        "src/exceptions",
        "src/judy/src",
    ]
    macros = ["BUILD_FLX_GC"]
    libs = [
        call("buildsystem.judy.build_runtime", host_phase, target_phase),
        call("buildsystem.flx_exceptions.build_runtime", target_phase),
        call("buildsystem.flx_pthread.build_runtime", target_phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(
            target_phase, dst, srcs, includes=includes, macros=macros, libs=[lib.static for lib in libs]
        ),
        shared=buildsystem.build_cxx_shared_lib(
            target_phase, dst, srcs, includes=includes, macros=macros, libs=[lib.shared for lib in libs]
        ),
    )
Пример #39
0
def build(ctx):
    ocaml = fbuild.builders.ocaml.Ocaml(ctx)

    libb = ocaml.ocamlc.build_lib('libb', Path.glob('b*.ml{,i}'))
    liba = ocaml.ocamlc.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe = ocaml.ocamlc.build_exe('exe.byte', ['exe.ml'], libs=[libb, liba])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    libb = ocaml.ocamlopt.build_lib('libb', Path.glob('b*.ml{,i}'))
    liba = ocaml.ocamlopt.build_lib('liba',
                                    Path.glob('a*.ml{,i}'),
                                    libs=[libb])
    exe = ocaml.ocamlopt.build_exe('exe.native', ['exe.ml'], libs=[libb, liba])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])

    # We can also build bytecode and native libraries at the same time.
    libb = ocaml.build_lib('libb', Path.glob('b*.ml{,i}'))
    liba = ocaml.build_lib('liba', Path.glob('a*.ml{,i}'), libs=[libb])
    exe = ocaml.build_exe('exe2', ['exe.ml'], libs=[libb, liba])

    ctx.logger.log(' * running %s:' % exe.bytecode)
    ctx.execute([exe.bytecode])

    ctx.logger.log(' * running %s:' % exe.native)
    ctx.execute([exe.native])

    # We can also use packed files.
    pack = ocaml.ocamlc.build_pack('c', ['c1.ml', 'c2.ml'])
    exe = ocaml.ocamlc.build_exe('exe_packed', ['exe_packed.ml'], objs=[pack])

    ctx.logger.log(' * running %s:' % exe)
    ctx.execute([exe])
Пример #40
0
def build_skia(ctx, cxx):
    pkgs = ['freetype2', 'fontconfig']
    cflags = []
    # XXX
    libs = ['freetype', 'fontconfig']

    for pkg in pkgs:
        pkgconfig = PkgConfig(ctx, pkg)
        cflags.extend(pkgconfig.cflags())

    srcs = [
        # core
        'c/sk_paint.cpp',
        'c/sk_surface.cpp',
        'core/SkAAClip.cpp',
        'core/SkAnnotation.cpp',
        'core/SkAlphaRuns.cpp',
        'core/SkATrace.cpp',
        'core/SkAutoPixmapStorage.cpp',
        'core/SkBBHFactory.cpp',
        'core/SkBigPicture.cpp',
        'core/SkBitmap.cpp',
        'core/SkBitmapCache.cpp',
        'core/SkBitmapController.cpp',
        'core/SkBitmapDevice.cpp',
        'core/SkBitmapProcState.cpp',
        'core/SkBitmapProcState_matrixProcs.cpp',
        'core/SkBitmapProvider.cpp',
        'core/SkBlendMode.cpp',
        'core/SkBlitMask_D32.cpp',
        'core/SkBlitRow_D32.cpp',
        'core/SkBlitter.cpp',
        'core/SkBlitter_A8.cpp',
        'core/SkBlitter_ARGB32.cpp',
        'core/SkBlitter_RGB565.cpp',
        'core/SkBlitter_Sprite.cpp',
        'core/SkBlurImageFilter.cpp',
        'core/SkBuffer.cpp',
        'core/SkCachedData.cpp',
        'core/SkCanvas.cpp',
        'core/SkCoverageDelta.cpp',
        'core/SkClipStack.cpp',
        'core/SkClipStackDevice.cpp',
        'core/SkColor.cpp',
        'core/SkColorFilter.cpp',
        'core/SkColorLookUpTable.cpp',
        'core/SkColorMatrixFilterRowMajor255.cpp',
        'core/SkColorSpace.cpp',
        'core/SkColorSpace_A2B.cpp',
        'core/SkColorSpace_XYZ.cpp',
        'core/SkColorSpace_ICC.cpp',
        'core/SkColorSpaceXform.cpp',
        'core/SkColorSpaceXformCanvas.cpp',
        'core/SkColorSpaceXformer.cpp',
        'core/SkColorSpaceXformImageGenerator.cpp',
        'core/SkColorSpaceXform_A2B.cpp',
        'core/SkColorTable.cpp',
        'core/SkConvertPixels.cpp',
        'core/SkCpu.cpp',
        'core/SkCubicClipper.cpp',
        'core/SkData.cpp',
        'core/SkDataTable.cpp',
        'core/SkDebug.cpp',
        'core/SkDeferredDisplayListRecorder.cpp',
        'core/SkDeque.cpp',
        'core/SkDevice.cpp',
        'core/SkDeviceLooper.cpp',
        'core/SkDeviceProfile.cpp',
        'lazy/SkDiscardableMemoryPool.cpp',
        'core/SkDistanceFieldGen.cpp',
        'core/SkDither.cpp',
        'core/SkDocument.cpp',
        'core/SkDraw.cpp',
        'core/SkDraw_vertices.cpp',
        'core/SkDrawable.cpp',
        'core/SkDrawLooper.cpp',
        'core/SkDrawShadowInfo.cpp',
        'core/SkEdgeBuilder.cpp',
        'core/SkEdgeClipper.cpp',
        'core/SkExecutor.cpp',
        'core/SkAnalyticEdge.cpp',
        'core/SkFDot6Constants.cpp',
        'core/SkEdge.cpp',
        'core/SkArenaAlloc.cpp',
        'core/SkFlattenable.cpp',
        'core/SkFlattenableSerialization.cpp',
        'core/SkFont.cpp',
        'core/SkFontLCDConfig.cpp',
        'core/SkFontMgr.cpp',
        'core/SkFontStyle.cpp',
        'core/SkFontDescriptor.cpp',
        'core/SkFontStream.cpp',
        'core/SkGeometry.cpp',
        'core/SkGlobalInitialization_core.cpp',
        'core/SkGlyphCache.cpp',
        'core/SkGpuBlurUtils.cpp',
        'core/SkGraphics.cpp',
        'core/SkHalf.cpp',
        'core/SkICC.cpp',
        'core/SkImageFilter.cpp',
        'core/SkImageFilterCache.cpp',
        'core/SkImageInfo.cpp',
        'core/SkImageGenerator.cpp',
        'core/SkLineClipper.cpp',
        'core/SkLiteDL.cpp',
        'core/SkLiteRecorder.cpp',
        'core/SkLocalMatrixImageFilter.cpp',
        'core/SkMD5.cpp',
        'core/SkMallocPixelRef.cpp',
        'core/SkMask.cpp',
        'core/SkMaskBlurFilter.cpp',
        'core/SkMaskCache.cpp',
        'core/SkMaskFilter.cpp',
        'core/SkMaskGamma.cpp',
        'core/SkMath.cpp',
        'core/SkMatrix.cpp',
        'core/SkMatrix44.cpp',
        'core/SkMatrixImageFilter.cpp',
        'core/SkMetaData.cpp',
        'core/SkMipMap.cpp',
        'core/SkMiniRecorder.cpp',
        'core/SkModeColorFilter.cpp',
        'core/SkMultiPictureDraw.cpp',
        'core/SkLatticeIter.cpp',
        'core/SkOpts.cpp',
        'core/SkOverdrawCanvas.cpp',
        'core/SkPaint.cpp',
        'core/SkPaintPriv.cpp',
        'core/SkPath.cpp',
        'core/SkPathEffect.cpp',
        'core/SkPathMeasure.cpp',
        'core/SkPathRef.cpp',
        'core/SkPicture.cpp',
        'core/SkPictureAnalyzer.cpp',
        'core/SkPictureContentInfo.cpp',
        'core/SkPictureData.cpp',
        'core/SkPictureFlat.cpp',
        'core/SkPictureImageGenerator.cpp',
        'core/SkPicturePlayback.cpp',
        'core/SkPictureRecord.cpp',
        'core/SkPictureRecorder.cpp',
        'core/SkPixelRef.cpp',
        'core/SkPixmap.cpp',
        'core/SkPoint.cpp',
        'core/SkPoint3.cpp',
        'core/SkPtrRecorder.cpp',
        'core/SkQuadClipper.cpp',
        'core/SkRasterClip.cpp',
        'core/SkRasterPipeline.cpp',
        'core/SkRasterPipelineBlitter.cpp',
        'core/SkRasterizer.cpp',
        'core/SkReadBuffer.cpp',
        'core/SkRecord.cpp',
        'core/SkRecords.cpp',
        'core/SkRecordDraw.cpp',
        'core/SkRecordOpts.cpp',
        'core/SkRecordedDrawable.cpp',
        'core/SkRecorder.cpp',
        'core/SkRect.cpp',
        'core/SkRefDict.cpp',
        'core/SkRegion.cpp',
        'core/SkRegion_path.cpp',
        'core/SkResourceCache.cpp',
        'core/SkRRect.cpp',
        'core/SkRTree.cpp',
        'core/SkRWBuffer.cpp',
        'core/SkScalar.cpp',
        'core/SkScalerContext.cpp',
        'core/SkScan.cpp',
        'core/SkScan_AAAPath.cpp',
        'core/SkScan_DAAPath.cpp',
        'core/SkScan_AntiPath.cpp',
        'core/SkScan_Antihair.cpp',
        'core/SkScan_Hairline.cpp',
        'core/SkScan_Path.cpp',
        'core/SkSemaphore.cpp',
        'core/SkSharedMutex.cpp',
        'core/SkSpecialImage.cpp',
        'core/SkSpecialSurface.cpp',
        'core/SkSpinlock.cpp',
        'core/SkSpriteBlitter_ARGB32.cpp',
        'core/SkSpriteBlitter_RGB565.cpp',
        'core/SkStream.cpp',
        'core/SkString.cpp',
        'core/SkStringUtils.cpp',
        'core/SkStroke.cpp',
        'core/SkStrokeRec.cpp',
        'core/SkStrokerPriv.cpp',
        'core/SkSwizzle.cpp',
        'core/SkSRGB.cpp',
        'core/SkTaskGroup.cpp',
        'core/SkTextBlob.cpp',
        'core/SkTime.cpp',
        'core/SkThreadID.cpp',
        'core/SkTLS.cpp',
        'core/SkTSearch.cpp',
        'core/SkTypeface.cpp',
        'core/SkTypefaceCache.cpp',
        'core/SkUnPreMultiply.cpp',
        'core/SkUtils.cpp',
        'core/SkValidatingReadBuffer.cpp',
        'core/SkVertices.cpp',
        'core/SkVertState.cpp',
        'core/SkWriteBuffer.cpp',
        'core/SkWriter32.cpp',
        'core/SkXfermode.cpp',
        'core/SkXfermodeInterpretation.cpp',
        'core/SkYUVPlanesCache.cpp',
        'image/SkImage.cpp',
        'image/SkImage_Lazy.cpp',
        'image/SkImage_Raster.cpp',
        'image/SkSurface.cpp',
        'image/SkSurface_Raster.cpp',
        'pipe/SkPipeCanvas.cpp',
        'pipe/SkPipeReader.cpp',
        'shaders/SkBitmapProcShader.cpp',
        'shaders/SkColorFilterShader.cpp',
        'shaders/SkColorShader.cpp',
        'shaders/SkComposeShader.cpp',
        'shaders/SkImageShader.cpp',
        'shaders/SkLocalMatrixShader.cpp',
        'shaders/SkPictureShader.cpp',
        'shaders/SkShader.cpp',
        'pathops/SkAddIntersections.cpp',
        'pathops/SkDConicLineIntersection.cpp',
        'pathops/SkDCubicLineIntersection.cpp',
        'pathops/SkDCubicToQuads.cpp',
        'pathops/SkDLineIntersection.cpp',
        'pathops/SkDQuadLineIntersection.cpp',
        'pathops/SkIntersections.cpp',
        'pathops/SkOpAngle.cpp',
        'pathops/SkOpBuilder.cpp',
        'pathops/SkOpCoincidence.cpp',
        'pathops/SkOpContour.cpp',
        'pathops/SkOpCubicHull.cpp',
        'pathops/SkOpEdgeBuilder.cpp',
        'pathops/SkOpSegment.cpp',
        'pathops/SkOpSpan.cpp',
        'pathops/SkPathOpsCommon.cpp',
        'pathops/SkPathOpsConic.cpp',
        'pathops/SkPathOpsCubic.cpp',
        'pathops/SkPathOpsCurve.cpp',
        'pathops/SkPathOpsDebug.cpp',
        'pathops/SkPathOpsLine.cpp',
        'pathops/SkPathOpsOp.cpp',
        'pathops/SkPathOpsPoint.cpp',
        'pathops/SkPathOpsQuad.cpp',
        'pathops/SkPathOpsRect.cpp',
        'pathops/SkPathOpsSimplify.cpp',
        'pathops/SkPathOpsTSect.cpp',
        'pathops/SkPathOpsTightBounds.cpp',
        'pathops/SkPathOpsTypes.cpp',
        'pathops/SkPathOpsWinding.cpp',
        'pathops/SkPathWriter.cpp',
        'pathops/SkReduceOrder.cpp',
        'jumper/SkJumper.cpp',
        'jumper/SkJumper_stages.cpp',
        'jumper/SkJumper_stages_lowp.cpp',
        'jumper/SkJumper_generated.S',

        # utils
        'utils/SkBase64.cpp',
        'utils/SkBitmapSourceDeserializer.cpp',
        'utils/SkFrontBufferedStream.cpp',
        'utils/SkCamera.cpp',
        'utils/SkCanvasStack.cpp',
        'utils/SkCanvasStateUtils.cpp',
        'utils/SkCurveMeasure.cpp',
        'utils/SkDashPath.cpp',
        'utils/SkDeferredCanvas.cpp',
        'utils/SkDumpCanvas.cpp',
        'utils/SkEventTracer.cpp',
        'utils/SkInsetConvexPolygon.cpp',
        'utils/SkInterpolator.cpp',
        'utils/SkJSONWriter.cpp',
        'utils/SkMatrix22.cpp',
        'utils/SkMultiPictureDocument.cpp',
        'utils/SkNWayCanvas.cpp',
        'utils/SkNullCanvas.cpp',
        'utils/SkOSPath.cpp',
        'utils/SkPaintFilterCanvas.cpp',
        'utils/SkParse.cpp',
        'utils/SkParseColor.cpp',
        'utils/SkParsePath.cpp',
        'utils/SkPatchUtils.cpp',
        'utils/SkShadowTessellator.cpp',
        'utils/SkShadowUtils.cpp',
        'utils/SkTextBox.cpp',
        'utils/SkThreadUtils_pthread.cpp',
        # 'utils/SkThreadUtils_win.cpp',
        'utils/SkWhitelistTypefaces.cpp',

        # xps
        'xps/SkXPSDocument.cpp',
        'xps/SkXPSDevice.cpp',

        # others
        # 'android/SkAndroidFrameworkUtils.cpp',
        # 'android/SkBitmapRegionCodec.cpp',
        # 'android/SkBitmapRegionDecoder.cpp',
        # 'codec/SkAndroidCodec.cpp',
        'codec/SkBmpBaseCodec.cpp',
        'codec/SkBmpCodec.cpp',
        'codec/SkBmpMaskCodec.cpp',
        'codec/SkBmpRLECodec.cpp',
        'codec/SkBmpStandardCodec.cpp',
        'codec/SkCodec.cpp',
        'codec/SkCodecImageGenerator.cpp',
        'codec/SkGifCodec.cpp',
        'codec/SkMaskSwizzler.cpp',
        'codec/SkMasks.cpp',
        'codec/SkSampledCodec.cpp',
        'codec/SkSampler.cpp',
        'codec/SkStreamBuffer.cpp',
        'codec/SkSwizzler.cpp',
        'codec/SkWbmpCodec.cpp',
        'images/SkImageEncoder.cpp',
        'ports/SkDiscardableMemory_none.cpp',
        'ports/SkImageGenerator_skia.cpp',
        'ports/SkMemory_malloc.cpp',
        'ports/SkOSFile_stdio.cpp',
        'ports/SkOSFile_posix.cpp',
        'ports/SkTLS_pthread.cpp',
        'sfnt/SkOTTable_name.cpp',
        'sfnt/SkOTUtils.cpp',
        # 'utils/mac/SkStream_mac.cpp',
        'ports/SkDebug_stdio.cpp',

        # opts
        'opts/SkBlitRow_opts_none.cpp',
        'opts/SkBlitMask_opts_none.cpp',
        'opts/SkBitmapProcState_opts_none.cpp',
        # 'opts/SkBitmapProcState_opts_SSE2.cpp',
        # 'opts/SkBlitRow_opts_SSE2.cpp',
        # 'opts/SkBlitMask_opts_none.cpp',

        # 'opts/SkBitmapProcState_opts_SSSE3.cpp',
        'opts/SkOpts_ssse3.cpp',
        'opts/SkOpts_sse41.cpp',
        'opts/SkOpts_sse42.cpp',
        'opts/SkOpts_avx.cpp',
        # 'opts/opts_check_x86.cpp',

        # effects
        'ports/SkGlobalInitialization_none.cpp',

        # fontmgr_fontconfig
        'ports/SkFontConfigInterface.cpp',
        'ports/SkFontConfigInterface_direct.cpp',
        'ports/SkFontConfigInterface_direct_factory.cpp',
        'ports/SkFontMgr_FontConfigInterface.cpp',
        'ports/SkFontMgr_fontconfig.cpp',
        'ports/SkFontMgr_fontconfig_factory.cpp',

        # gpu
        'gpu/gl/GrGLDefaultInterface_native.cpp',
        'gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp',
        'gpu/GrAuditTrail.cpp',
        'gpu/GrBackendSurface.cpp',
        'gpu/GrBackendTextureImageGenerator.cpp',
        'gpu/GrAHardwareBufferImageGenerator.cpp',
        'gpu/GrBitmapTextureMaker.cpp',
        'gpu/GrBlend.cpp',
        'gpu/GrBlurUtils.cpp',
        'gpu/GrBuffer.cpp',
        'gpu/GrBufferAllocPool.cpp',
        'gpu/GrCaps.cpp',
        'gpu/GrClipStackClip.cpp',
        'gpu/GrColorSpaceXform.cpp',
        'gpu/GrContext.cpp',
        'gpu/GrDefaultGeoProcFactory.cpp',
        'gpu/GrDistanceFieldGenFromVector.cpp',
        'gpu/GrDrawingManager.cpp',
        'gpu/GrDrawOpAtlas.cpp',
        'gpu/GrDrawOpTest.cpp',
        'gpu/GrFixedClip.cpp',
        'gpu/GrFragmentProcessor.cpp',
        'gpu/GrGpu.cpp',
        'gpu/GrGpuCommandBuffer.cpp',
        'gpu/GrGpuResource.cpp',
        'gpu/GrGpuFactory.cpp',
        'gpu/GrImageTextureMaker.cpp',
        'gpu/GrMemoryPool.cpp',
        'gpu/GrOpFlushState.cpp',
        'gpu/GrOpList.cpp',
        'gpu/GrPaint.cpp',
        'gpu/GrPath.cpp',
        'gpu/GrPathProcessor.cpp',
        'gpu/GrPathRange.cpp',
        'gpu/GrPathRendererChain.cpp',
        'gpu/GrPathRenderer.cpp',
        'gpu/GrPathRendering.cpp',
        'gpu/GrPathUtils.cpp',
        'gpu/GrOnFlushResourceProvider.cpp',
        'gpu/GrPipeline.cpp',
        'gpu/GrPrimitiveProcessor.cpp',
        'gpu/GrProcessorSet.cpp',
        'gpu/GrProgramDesc.cpp',
        'gpu/GrProcessor.cpp',
        'gpu/GrProcessorAnalysis.cpp',
        'gpu/GrProcessorUnitTest.cpp',
        'gpu/GrGpuResourceRef.cpp',
        'gpu/GrRectanizer_pow2.cpp',
        'gpu/GrRectanizer_skyline.cpp',
        'gpu/GrRenderTarget.cpp',
        'gpu/GrRenderTargetProxy.cpp',
        'gpu/GrReducedClip.cpp',
        'gpu/GrRenderTargetContext.cpp',
        'gpu/GrPathRenderingRenderTargetContext.cpp',
        'gpu/GrRenderTargetOpList.cpp',
        'gpu/GrResourceAllocator.cpp',
        'gpu/GrResourceCache.cpp',
        'gpu/GrResourceProvider.cpp',
        'gpu/GrShaderCaps.cpp',
        'gpu/GrShape.cpp',
        'gpu/GrStencilAttachment.cpp',
        'gpu/GrStencilSettings.cpp',
        'gpu/GrStyle.cpp',
        'gpu/GrTessellator.cpp',
        'gpu/GrTextureOpList.cpp',
        'gpu/GrTestUtils.cpp',
        'gpu/GrShaderVar.cpp',
        'gpu/GrSKSLPrettyPrint.cpp',
        'gpu/GrSoftwarePathRenderer.cpp',
        'gpu/GrSurface.cpp',
        'gpu/GrSurfaceContext.cpp',
        'gpu/GrSurfaceProxy.cpp',
        'gpu/GrSWMaskHelper.cpp',
        'gpu/GrTexture.cpp',
        'gpu/GrTextureAdjuster.cpp',
        'gpu/GrTextureContext.cpp',
        'gpu/GrTextureMaker.cpp',
        'gpu/GrTextureProducer.cpp',
        'gpu/GrTextureProxy.cpp',
        'gpu/GrTextureRenderTargetProxy.cpp',
        'gpu/GrXferProcessor.cpp',
        'gpu/GrYUVProvider.cpp',
        'gpu/ops/GrAAConvexTessellator.cpp',
        'gpu/ops/GrAAConvexPathRenderer.cpp',
        'gpu/ops/GrAAFillRectOp.cpp',
        'gpu/ops/GrAAHairLinePathRenderer.cpp',
        'gpu/ops/GrAALinearizingConvexPathRenderer.cpp',
        'gpu/ops/GrAAStrokeRectOp.cpp',
        'gpu/ops/GrAtlasTextOp.cpp',
        'gpu/ops/GrClearOp.cpp',
        'gpu/ops/GrCopySurfaceOp.cpp',
        'gpu/ops/GrDashLinePathRenderer.cpp',
        'gpu/ops/GrDashOp.cpp',
        'gpu/ops/GrDefaultPathRenderer.cpp',
        'gpu/ops/GrDrawAtlasOp.cpp',
        'gpu/ops/GrDrawPathOp.cpp',
        'gpu/ops/GrDrawVerticesOp.cpp',
        'gpu/ops/GrMeshDrawOp.cpp',
        'gpu/ops/GrMSAAPathRenderer.cpp',
        'gpu/ops/GrNonAAFillRectOp.cpp',
        'gpu/ops/GrNonAAStrokeRectOp.cpp',
        'gpu/ops/GrLatticeOp.cpp',
        'gpu/ops/GrOp.cpp',
        'gpu/ops/GrOvalOpFactory.cpp',
        'gpu/ops/GrRegionOp.cpp',
        'gpu/ops/GrSemaphoreOp.cpp',
        'gpu/ops/GrShadowRRectOp.cpp',
        'gpu/ops/GrSimpleMeshDrawOpHelper.cpp',
        'gpu/ops/GrSmallPathRenderer.cpp',
        'gpu/ops/GrStencilAndCoverPathRenderer.cpp',
        'gpu/ops/GrStencilPathOp.cpp',
        'gpu/ops/GrTessellatingPathRenderer.cpp',
        'gpu/ops/GrTextureOp.cpp',
        'gpu/ccpr/GrCCPRAtlas.cpp',
        'gpu/ccpr/GrCCPRCoverageOp.cpp',
        'gpu/ccpr/GrCCPRCoverageProcessor.cpp',
        'gpu/ccpr/GrCCPRCubicProcessor.cpp',
        'gpu/ccpr/GrCCPRGeometry.cpp',
        'gpu/ccpr/GrCCPRPathProcessor.cpp',
        'gpu/ccpr/GrCCPRQuadraticProcessor.cpp',
        'gpu/ccpr/GrCCPRTriangleProcessor.cpp',
        'gpu/ccpr/GrCoverageCountingPathRenderer.cpp',
        'gpu/effects/GrArithmeticFP.cpp',
        'gpu/effects/GrBlurredEdgeFragmentProcessor.cpp',
        'gpu/effects/GrCircleEffect.cpp',
        'gpu/effects/GrConfigConversionEffect.cpp',
        'gpu/effects/GrConstColorProcessor.cpp',
        'gpu/effects/GrCoverageSetOpXP.cpp',
        'gpu/effects/GrCustomXfermode.cpp',
        'gpu/effects/GrBezierEffect.cpp',
        'gpu/effects/GrConvexPolyEffect.cpp',
        'gpu/effects/GrBicubicEffect.cpp',
        'gpu/effects/GrBitmapTextGeoProc.cpp',
        'gpu/effects/GrDisableColorXP.cpp',
        'gpu/effects/GrDistanceFieldGeoProc.cpp',
        'gpu/effects/GrDitherEffect.cpp',
        'gpu/effects/GrEllipseEffect.cpp',
        'gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp',
        'gpu/effects/GrMatrixConvolutionEffect.cpp',
        'gpu/effects/GrNonlinearColorSpaceXformEffect.cpp',
        'gpu/effects/GrOvalEffect.cpp',
        'gpu/effects/GrPorterDuffXferProcessor.cpp',
        'gpu/effects/GrRRectEffect.cpp',
        'gpu/effects/GrShadowGeoProc.cpp',
        'gpu/effects/GrSimpleTextureEffect.cpp',
        'gpu/effects/GrSRGBEffect.cpp',
        'gpu/effects/GrTextureDomain.cpp',
        'gpu/effects/GrTextureStripAtlas.cpp',
        'gpu/effects/GrXfermodeFragmentProcessor.cpp',
        'gpu/effects/GrYUVEffect.cpp',
        'gpu/instanced/InstancedOp.cpp',
        'gpu/instanced/InstancedRendering.cpp',
        'gpu/instanced/InstanceProcessor.cpp',
        'gpu/instanced/GLInstancedRendering.cpp',
        'gpu/text/GrAtlasGlyphCache.cpp',
        'gpu/text/GrAtlasTextBlob.cpp',
        'gpu/text/GrAtlasTextBlob_regenInOp.cpp',
        'gpu/text/GrAtlasTextContext.cpp',
        'gpu/text/GrDistanceFieldAdjustTable.cpp',
        'gpu/text/GrStencilAndCoverTextContext.cpp',
        'gpu/text/GrTextBlobCache.cpp',
        'gpu/text/GrTextUtils.cpp',
        'gpu/gl/GrGLAssembleInterface.cpp',
        'gpu/gl/GrGLBuffer.cpp',
        'gpu/gl/GrGLCaps.cpp',
        'gpu/gl/GrGLContext.cpp',
        'gpu/gl/GrGLCreateNativeInterface_none.cpp',
        'gpu/gl/GrGLCreateNullInterface.cpp',
        'gpu/gl/GrGLDefaultInterface_none.cpp',
        'gpu/gl/GrGLGLSL.cpp',
        'gpu/gl/GrGLGpu.cpp',
        'gpu/gl/GrGLGpuCommandBuffer.cpp',
        'gpu/gl/GrGLGpuProgramCache.cpp',
        'gpu/gl/GrGLExtensions.cpp',
        'gpu/gl/GrGLInterface.cpp',
        'gpu/gl/GrGLPath.cpp',
        'gpu/gl/GrGLPathRange.cpp',
        'gpu/gl/GrGLPathRendering.cpp',
        'gpu/gl/GrGLProgram.cpp',
        'gpu/gl/GrGLProgramDataManager.cpp',
        'gpu/gl/GrGLRenderTarget.cpp',
        'gpu/gl/GrGLSemaphore.cpp',
        'gpu/gl/GrGLStencilAttachment.cpp',
        'gpu/gl/GrGLTestInterface.cpp',
        'gpu/gl/GrGLTexture.cpp',
        'gpu/gl/GrGLTextureRenderTarget.cpp',
        'gpu/gl/GrGLUtil.cpp',
        'gpu/gl/GrGLUniformHandler.cpp',
        'gpu/gl/GrGLVaryingHandler.cpp',
        'gpu/gl/GrGLVertexArray.cpp',
        'gpu/gl/builders/GrGLProgramBuilder.cpp',
        'gpu/gl/builders/GrGLShaderStringBuilder.cpp',
        'gpu/glsl/GrGLSL.cpp',
        'gpu/glsl/GrGLSLBlend.cpp',
        'gpu/glsl/GrGLSLFragmentProcessor.cpp',
        'gpu/glsl/GrGLSLFragmentShaderBuilder.cpp',
        'gpu/glsl/GrGLSLGeometryProcessor.cpp',
        'gpu/glsl/GrGLSLGeometryShaderBuilder.cpp',
        'gpu/glsl/GrGLSLPrimitiveProcessor.cpp',
        'gpu/glsl/GrGLSLProgramBuilder.cpp',
        'gpu/glsl/GrGLSLProgramDataManager.cpp',
        'gpu/glsl/GrGLSLShaderBuilder.cpp',
        'gpu/glsl/GrGLSLUtil.cpp',
        'gpu/glsl/GrGLSLVarying.cpp',
        'gpu/glsl/GrGLSLVertexShaderBuilder.cpp',
        'gpu/glsl/GrGLSLXferProcessor.cpp',
        'gpu/mock/GrMockGpu.cpp',
        'gpu/SkGpuDevice.cpp',
        'gpu/SkGpuDevice_drawTexture.cpp',
        'gpu/SkGr.cpp',
        'image/SkImage_Gpu.cpp',
        'image/SkSurface_Gpu.cpp',

        # sksl
        'sksl/SkSLCFGGenerator.cpp',
        'sksl/SkSLCompiler.cpp',
        'sksl/SkSLCPPCodeGenerator.cpp',
        'sksl/SkSLGLSLCodeGenerator.cpp',
        'sksl/SkSLHCodeGenerator.cpp',
        'sksl/SkSLIRGenerator.cpp',
        'sksl/SkSLLexer.cpp',
        'sksl/SkSLLayoutLexer.cpp',
        'sksl/SkSLParser.cpp',
        'sksl/SkSLSPIRVCodeGenerator.cpp',
        'sksl/SkSLString.cpp',
        'sksl/SkSLUtil.cpp',
        'sksl/ir/SkSLSymbolTable.cpp',
        'sksl/ir/SkSLSetting.cpp',
        'sksl/ir/SkSLType.cpp',

        # freetype
        'ports/SkFontHost_FreeType.cpp',
        'ports/SkFontHost_FreeType_common.cpp',
    ]

    sources = skia_sources(*srcs)
    sources.append('deps/skia/third_party/gif/SkGifImageReader.cpp')

    public_includes = Path.glob('deps/skia/include/*')
    lib = cxx.build_lib('skia', sources, macros=['SK_ENABLE_DISCRETE_GPU'],
                        includes=Path.glob('deps/skia/src/*') + public_includes + \
                                 ['deps/skia/third_party/gif'],
                        cflags=cflags, external_libs=libs)
    return Record(includes=public_includes + ['deps/skia/src/gpu'], lib=lib)
Пример #41
0
def build_flx_version(phase):
    path = Path ('src/compiler/flx_version')
    return phase.ocaml.build_lib(path / 'flx_version',
        srcs=Path.glob(path / '*.ml{,i}'))
Пример #42
0
Файл: tre.py Проект: arowM/felix
def build_runtime(phase):
    path = Path('src/tre/tre')

    alloca_h = config_call('fbuild.config.c.malloc.alloca_h', phase.platform, phase.c.static)
    dlfcn_h = config_call('fbuild.config.c.posix.dlfcn_h', phase.platform, phase.c.static, phase.c.shared)
    getopt_h = config_call('fbuild.config.c.gnu.getopt_h', phase.platform, phase.c.static)
    inttypes_h = config_call('fbuild.config.c.posix.inttypes_h', phase.platform, phase.c.static)
    libutf8_h = config_call('fbuild.config.c.libutf8.libutf8_h', phase.platform, phase.c.static)
    memory_h = config_call('fbuild.config.c.bsd.memory_h', phase.platform, phase.c.static)
    regex_h = config_call('fbuild.config.c.posix.regex_h', phase.platform, phase.c.static)
    stdint_h = config_call('fbuild.config.c.c99.stdint_h', phase.platform, phase.c.static)
    stdlib_h = config_call('fbuild.config.c.posix.stdlib_h', phase.platform, phase.c.static)
    string_h = config_call('fbuild.config.c.c99.string_h', phase.platform, phase.c.static)
    strings_h = config_call('fbuild.config.c.posix.strings_h', phase.platform, phase.c.static)
    sys_stat_h = config_call('fbuild.config.c.posix.sys_stat_h', phase.platform, phase.c.static)
    sys_types_h = config_call('fbuild.config.c.posix.sys_types_h', phase.platform, phase.c.static)
    unistd_h = config_call('fbuild.config.c.posix.unistd_h', phase.platform, phase.c.static)
    wchar_h = config_call('fbuild.config.c.posix.wchar_h', phase.platform, phase.c.static)
    wctype_h = config_call('fbuild.config.c.posix.wctype_h', phase.platform, phase.c.static)

    if 'win32' in phase.platform:
        inline = '__inline'
    else:
        inline = None

    patterns = {
        'CRAY_STACKSEG_END': None,
        'C_ALLOCA': None,
        'ENABLE_NLS': 0,
        'HAVE_ALLOCA': alloca_h.alloca is not None,
        'HAVE_WCSLEN': wchar_h.wcslen is not None,
        'NDEBUG': 1,
        'HAVE_ALLOCA_H': alloca_h.header is not None,
        'HAVE_CFLOCALECOPYCURRENT': None,
        'HAVE_CFPREFERENCESCOPYAPPVALUE': None,
        'HAVE_DCGETTEXT': None,
        'HAVE_DLFCN_H': dlfcn_h.header is not None,
        'HAVE_GETOPT_H': getopt_h.header is not None ,
        'HAVE_GETOPT_LONG': getopt_h.getopt_long is not None,
        'HAVE_GETTEXT': None,
        'HAVE_ICONV': None,
        'HAVE_INTTYPES_H': inttypes_h.header is not None,
        'HAVE_ISASCII': 1,
        'HAVE_ISBLANK': 1,
        'HAVE_ISWASCII': wctype_h.iswascii is not None,
        'HAVE_ISWBLANK': wctype_h.iswblank is not None,
        'HAVE_ISWCTYPE': wctype_h.iswctype is not None,
        'HAVE_ISWLOWER': wctype_h.iswlower is not None,
        'HAVE_ISWUPPER': wctype_h.iswupper is not None,
        'HAVE_LIBUTF8_H': libutf8_h.header is not None,
        'HAVE_MBRTOWC': wchar_h.mbrtowc is not None,
        'HAVE_MBSTATE_T': wchar_h.mbstate_t is not None,
        'HAVE_MBTOWC': stdlib_h.mbtowc is not None,
        'HAVE_MEMORY_H': memory_h.header is not None,
        'HAVE_REGEX_H': regex_h.header is not None,
        'HAVE_REG_ERRCODE_T': regex_h.reg_errcode_t is not None,
        'HAVE_STDINT_H': stdint_h.header is not None,
        'HAVE_STDLIB_H': stdlib_h.header is not None,
        'HAVE_STRINGS_H': strings_h.header is not None,
        'HAVE_STRING_H': string_h.header is not None,
        'HAVE_SYS_STAT_H': sys_stat_h.header is not None,
        'HAVE_SYS_TYPES_H': sys_types_h.header is not None,
        'HAVE_TOWLOWER': wctype_h.towlower is not None,
        'HAVE_TOWUPPER': wctype_h.towupper is not None,
        'HAVE_UNISTD_H': unistd_h.header is not None,
        'HAVE_WCHAR_H': wchar_h.header is not None,
        'HAVE_WCHAR_T': wchar_h.wchar_t is not None,
        'HAVE_WCSCHR': wchar_h.wcschr is not None,
        'HAVE_WCSCPY': wchar_h.wcscpy is not None,
        'HAVE_WCSNCPY': wchar_h.wcsncpy is not None,
        'HAVE_WCSRTOMBS': wchar_h.wcsrtombs is not None,
        'HAVE_WCSTOMBS': stdlib_h.wcstombs is not None,
        'HAVE_WCTYPE': wctype_h.wctype is not None,
        'HAVE_WCTYPE_H': wctype_h.header is not None,
        'HAVE_WINT_T': wctype_h.wint_t is not None,
        'NO_MINUS_C_MINUS_O': None,
        'PACKAGE': '"tre"',
        'PACKAGE_TARNAME': '"tre"',
        'PACKAGE_VERSION': '"0.8.0"',
        'STACK_DIRECTION': None,
        'VERSION': '"0.8.0"',
        'PACKAGE_BUGREPORT': '"*****@*****.**"',
        'PACKAGE_NAME': '"TRE"',
        'PACKAGE_STRING': '"TRE 0.8.0"',
        'PACKAGE_TARFILE': 'tre',
        'STDC_HEADERS': 1,
        'TRE_APPROX': 1,
        'TRE_DEBUG': None,
        'TRE_MULTIBYTE': wchar_h.header is not None,
        'TRE_REGEX_T_FIELD': 'value',
        'TRE_SYSTEM_REGEX_H_PATH': None,
        'TRE_USE_ALLOCA': alloca_h.alloca is not None,
        'TRE_USE_SYSTEM_REGEX_H': None,
        'TRE_VERSION': '"0.8.0"',
        'TRE_VERSION_1': '0',
        'TRE_VERSION_2': '8',
        'TRE_VERSION_3': '0',
        'TRE_WCHAR': wchar_h.header is not None,
        'WCHAR_MAX': None,
        'WCHAR_T_SIGNED': None,
        'WCHAR_T_UNSIGNED': None,
        '_FILE_OFFSET_BITS': None,
        '_GNU_SOURCE': 1,
        '_LARGE_FILES': None,
        '_REGCOMP_INTERNAL': None,
        'const': None,
        'inline': inline,
    }

    fbuild.builders.text.autoconf_config_header(phase.ctx,
        path / 'config.h',
        path / 'config.h.in',
        patterns)

    fbuild.builders.text.autoconf_config_header(phase.ctx,
        path / 'lib/tre-config.h',
        path / 'lib/tre-config.h.in',
        patterns)

    buildsystem.copy_to(phase.ctx, phase.ctx.buildroot / 'lib/rtl/tre', [
        path / 'lib/tre.h',
        phase.ctx.buildroot / path / 'lib/tre-config.h'])

    dst = 'lib/rtl/tre'
    srcs = Path.glob('src/tre/tre/lib/*.c')
    includes = [
        phase.ctx.buildroot / 'config/target',
        phase.ctx.buildroot / path,
        phase.ctx.buildroot / path / 'lib',
        path / 'gnulib/lib',
    ]
    macros = ['HAVE_CONFIG_H', 'BUILD_TRE']

    #Workaround link error : unresolved external symbol _snprintf
    #referenced in function _tre_version.

    if 'win32' in phase.platform:
        macros.append('snprintf=_snprintf')

    return Record(
        static=buildsystem.build_c_static_lib(phase, dst, srcs,
            includes=includes,
            macros=macros),
        shared=buildsystem.build_c_shared_lib(phase, dst, srcs,
            includes=includes,
            macros=macros))
Пример #43
0
def build_flx_version(phase):
    path = Path('src/compiler/flx_version')
    return phase.ocaml.build_lib(path / 'flx_version',
                                 srcs=Path.glob(path / '*.ml{,i}'))
Пример #44
0
def build_lib(phase):
    path = Path('src/compiler/dypgen/dyplib')
    return phase.ocaml.build_lib(path / 'dyp', Path.glob(path / '*.ml{,i}'))
Пример #45
0
def build_flx_version_hook(phase):
    path = phase.ctx.buildroot / 'src/compiler/flx_version_hook'
    return phase.ocaml.build_lib(path / 'flx_version_hook',
                                 srcs=Path.glob(path / '*.ml{,i}'),
                                 libs=[build_flx_version(phase)])
Пример #46
0
def build_flx_misc(phase):
    path = Path('src/compiler/flx_misc')
    return phase.ocaml.build_lib(path / 'flx_misc',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[build_flx_version(phase)],
        external_libs=['nums', 'str', 'unix'])
Пример #47
0
from fbuild.target import register
from fbuild.path import Path
import fbuild.db


@fbuild.db.caches
def cp(ctx, src: fbuild.db.SRC, dst: fbuild.db.DST):
    ctx.execute(['cp', src, dst], 'cp')


for path in Path.glob('*.in'):
    out = path.replaceext('.out')

    @register(name=str(out))
    def func(ctx):
        cp(ctx, path, out)
Пример #48
0
def build_skia(ctx, platform, cxx, freetype, fontconfig):
    srcs = [
        # core
        'c/sk_paint.cpp',
        'c/sk_surface.cpp',
        'core/SkAAClip.cpp',
        'core/SkAnnotation.cpp',
        'core/SkAlphaRuns.cpp',
        'core/SkATrace.cpp',
        'core/SkAutoPixmapStorage.cpp',
        'core/SkBBHFactory.cpp',
        'core/SkBigPicture.cpp',
        'core/SkBitmap.cpp',
        'core/SkBitmapCache.cpp',
        'core/SkBitmapController.cpp',
        'core/SkBitmapDevice.cpp',
        'core/SkBitmapProcState.cpp',
        'core/SkBitmapProcState_matrixProcs.cpp',
        'core/SkBitmapProvider.cpp',
        'core/SkBlendMode.cpp',
        'core/SkBlitMask_D32.cpp',
        'core/SkBlitRow_D32.cpp',
        'core/SkBlitter.cpp',
        'core/SkBlitter_A8.cpp',
        'core/SkBlitter_ARGB32.cpp',
        'core/SkBlitter_RGB565.cpp',
        'core/SkBlitter_Sprite.cpp',
        'core/SkBlurImageFilter.cpp',
        'core/SkBuffer.cpp',
        'core/SkCachedData.cpp',
        'core/SkCanvas.cpp',
        'core/SkCanvasPriv.cpp',
        'core/SkCoverageDelta.cpp',
        'core/SkClipStack.cpp',
        'core/SkClipStackDevice.cpp',
        'core/SkColor.cpp',
        'core/SkColorFilter.cpp',
        'core/SkColorLookUpTable.cpp',
        'core/SkColorMatrixFilterRowMajor255.cpp',
        'core/SkColorSpace.cpp',
        'core/SkColorSpace_A2B.cpp',
        'core/SkColorSpace_New.cpp',
        'core/SkColorSpace_XYZ.cpp',
        'core/SkColorSpace_ICC.cpp',
        'core/SkColorSpaceXform.cpp',
        'core/SkColorSpaceXformCanvas.cpp',
        'core/SkColorSpaceXformer.cpp',
        'core/SkColorSpaceXformImageGenerator.cpp',
        'core/SkColorSpaceXform_A2B.cpp',
        'core/SkColorTable.cpp',
        'core/SkConvertPixels.cpp',
        'core/SkCpu.cpp',
        'core/SkCubicClipper.cpp',
        'core/SkCubicMap.cpp',
        'core/SkData.cpp',
        'core/SkDataTable.cpp',
        'core/SkDebug.cpp',
        'core/SkDeferredDisplayListRecorder.cpp',
        'core/SkDeque.cpp',
        'core/SkDevice.cpp',
        'core/SkDeviceLooper.cpp',
        'core/SkDeviceProfile.cpp',
        'lazy/SkDiscardableMemoryPool.cpp',
        'core/SkDistanceFieldGen.cpp',
        'core/SkDither.cpp',
        'core/SkDocument.cpp',
        'core/SkDraw.cpp',
        'core/SkDraw_vertices.cpp',
        'core/SkDrawable.cpp',
        'core/SkDrawLooper.cpp',
        'core/SkDrawShadowInfo.cpp',
        'core/SkEdgeBuilder.cpp',
        'core/SkEdgeClipper.cpp',
        'core/SkExecutor.cpp',
        'core/SkAnalyticEdge.cpp',
        'core/SkFDot6Constants.cpp',
        'core/SkEdge.cpp',
        'core/SkArenaAlloc.cpp',
        'core/SkGaussFilter.cpp',
        'core/SkFlattenable.cpp',
        'core/SkFlattenableSerialization.cpp',
        'core/SkFont.cpp',
        'core/SkFontLCDConfig.cpp',
        'core/SkFontMgr.cpp',
        'core/SkFontDescriptor.cpp',
        'core/SkFontStream.cpp',
        'core/SkGeometry.cpp',
        'core/SkGlobalInitialization_core.cpp',
        'core/SkGlyphCache.cpp',
        'core/SkGpuBlurUtils.cpp',
        'core/SkGraphics.cpp',
        'core/SkHalf.cpp',
        'core/SkICC.cpp',
        'core/SkImageFilter.cpp',
        'core/SkImageFilterCache.cpp',
        'core/SkImageInfo.cpp',
        'core/SkImageGenerator.cpp',
        'core/SkLineClipper.cpp',
        'core/SkLiteDL.cpp',
        'core/SkLiteRecorder.cpp',
        'core/SkLocalMatrixImageFilter.cpp',
        'core/SkMD5.cpp',
        'core/SkMallocPixelRef.cpp',
        'core/SkMask.cpp',
        'core/SkMaskBlurFilter.cpp',
        'core/SkMaskCache.cpp',
        'core/SkMaskFilter.cpp',
        'core/SkMaskGamma.cpp',
        'core/SkMath.cpp',
        'core/SkMatrix.cpp',
        'core/SkMatrix44.cpp',
        'core/SkMatrixImageFilter.cpp',
        'core/SkMetaData.cpp',
        'core/SkMipMap.cpp',
        'core/SkMiniRecorder.cpp',
        'core/SkModeColorFilter.cpp',
        'core/SkMultiPictureDraw.cpp',
        'core/SkLatticeIter.cpp',
        'core/SkOpts.cpp',
        'core/SkOverdrawCanvas.cpp',
        'core/SkPaint.cpp',
        'core/SkPaintPriv.cpp',
        'core/SkPath.cpp',
        'core/SkPathEffect.cpp',
        'core/SkPathMeasure.cpp',
        'core/SkPathRef.cpp',
        'core/SkPicture.cpp',
        'core/SkPictureContentInfo.cpp',
        'core/SkPictureData.cpp',
        'core/SkPictureFlat.cpp',
        'core/SkPictureImageGenerator.cpp',
        'core/SkPicturePlayback.cpp',
        'core/SkPictureRecord.cpp',
        'core/SkPictureRecorder.cpp',
        'core/SkPixelRef.cpp',
        'core/SkPixmap.cpp',
        'core/SkPoint.cpp',
        'core/SkPoint3.cpp',
        'core/SkPtrRecorder.cpp',
        'core/SkQuadClipper.cpp',
        'core/SkRasterClip.cpp',
        'core/SkRasterPipeline.cpp',
        'core/SkRasterPipelineBlitter.cpp',
        'core/SkRasterizer.cpp',
        'core/SkReadBuffer.cpp',
        'core/SkRecord.cpp',
        'core/SkRecords.cpp',
        'core/SkRecordDraw.cpp',
        'core/SkRecordOpts.cpp',
        'core/SkRecordedDrawable.cpp',
        'core/SkRecorder.cpp',
        'core/SkRect.cpp',
        'core/SkRefDict.cpp',
        'core/SkRegion.cpp',
        'core/SkRegion_path.cpp',
        'core/SkResourceCache.cpp',
        'core/SkRRect.cpp',
        'core/SkRTree.cpp',
        'core/SkRWBuffer.cpp',
        'core/SkScalar.cpp',
        'core/SkScalerContext.cpp',
        'core/SkScan.cpp',
        'core/SkScan_AAAPath.cpp',
        'core/SkScan_DAAPath.cpp',
        'core/SkScan_AntiPath.cpp',
        'core/SkScan_Antihair.cpp',
        'core/SkScan_Hairline.cpp',
        'core/SkScan_Path.cpp',
        'core/SkSemaphore.cpp',
        'core/SkSharedMutex.cpp',
        'core/SkSpecialImage.cpp',
        'core/SkSpecialSurface.cpp',
        'core/SkSpinlock.cpp',
        'core/SkSpriteBlitter_ARGB32.cpp',
        'core/SkSpriteBlitter_RGB565.cpp',
        'core/SkStream.cpp',
        'core/SkString.cpp',
        'core/SkStringUtils.cpp',
        'core/SkStroke.cpp',
        'core/SkStrokeRec.cpp',
        'core/SkStrokerPriv.cpp',
        'core/SkSwizzle.cpp',
        'core/SkSRGB.cpp',
        'core/SkTaskGroup.cpp',
        'core/SkTaskGroup2D.cpp',
        'core/SkTextBlob.cpp',
        'core/SkTime.cpp',
        'core/SkThreadID.cpp',
        'core/SkTLS.cpp',
        'core/SkTSearch.cpp',
        'core/SkTypeface.cpp',
        'core/SkTypefaceCache.cpp',
        'core/SkUnPreMultiply.cpp',
        'core/SkUtils.cpp',
        'core/SkVertices.cpp',
        'core/SkVertState.cpp',
        'core/SkWriteBuffer.cpp',
        'core/SkWriter32.cpp',
        'core/SkXfermode.cpp',
        'core/SkXfermodeInterpretation.cpp',
        'core/SkYUVPlanesCache.cpp',
        'image/SkImage.cpp',
        'image/SkImage_Lazy.cpp',
        'image/SkImage_Raster.cpp',
        'image/SkSurface.cpp',
        'image/SkSurface_Raster.cpp',
        'pipe/SkPipeCanvas.cpp',
        'pipe/SkPipeReader.cpp',
        'shaders/SkBitmapProcShader.cpp',
        'shaders/SkColorFilterShader.cpp',
        'shaders/SkColorShader.cpp',
        'shaders/SkComposeShader.cpp',
        'shaders/SkImageShader.cpp',
        'shaders/SkLocalMatrixShader.cpp',
        'shaders/SkPictureShader.cpp',
        'shaders/SkShader.cpp',
        'pathops/SkAddIntersections.cpp',
        'pathops/SkDConicLineIntersection.cpp',
        'pathops/SkDCubicLineIntersection.cpp',
        'pathops/SkDCubicToQuads.cpp',
        'pathops/SkDLineIntersection.cpp',
        'pathops/SkDQuadLineIntersection.cpp',
        'pathops/SkIntersections.cpp',
        'pathops/SkOpAngle.cpp',
        'pathops/SkOpBuilder.cpp',
        'pathops/SkOpCoincidence.cpp',
        'pathops/SkOpContour.cpp',
        'pathops/SkOpCubicHull.cpp',
        'pathops/SkOpEdgeBuilder.cpp',
        'pathops/SkOpSegment.cpp',
        'pathops/SkOpSpan.cpp',
        'pathops/SkPathOpsCommon.cpp',
        'pathops/SkPathOpsConic.cpp',
        'pathops/SkPathOpsCubic.cpp',
        'pathops/SkPathOpsCurve.cpp',
        'pathops/SkPathOpsDebug.cpp',
        'pathops/SkPathOpsLine.cpp',
        'pathops/SkPathOpsOp.cpp',
        'pathops/SkPathOpsPoint.cpp',
        'pathops/SkPathOpsQuad.cpp',
        'pathops/SkPathOpsRect.cpp',
        'pathops/SkPathOpsSimplify.cpp',
        'pathops/SkPathOpsTSect.cpp',
        'pathops/SkPathOpsTightBounds.cpp',
        'pathops/SkPathOpsTypes.cpp',
        'pathops/SkPathOpsWinding.cpp',
        'pathops/SkPathWriter.cpp',
        'pathops/SkReduceOrder.cpp',
        'jumper/SkJumper.cpp',
        'jumper/SkJumper_stages.cpp',
        'jumper/SkJumper_stages_lowp.cpp',
        'jumper/SkJumper_generated.S',

        # utils
        'utils/SkBase64.cpp',
        'utils/SkFrontBufferedStream.cpp',
        'utils/SkCamera.cpp',
        'utils/SkCanvasStack.cpp',
        'utils/SkCanvasStateUtils.cpp',
        'utils/SkDashPath.cpp',
        'utils/SkDumpCanvas.cpp',
        'utils/SkEventTracer.cpp',
        'utils/SkFloatToDecimal.cpp',
        'utils/SkInsetConvexPolygon.cpp',
        'utils/SkInterpolator.cpp',
        'utils/SkJSONWriter.cpp',
        'utils/SkMatrix22.cpp',
        'utils/SkMultiPictureDocument.cpp',
        'utils/SkNWayCanvas.cpp',
        'utils/SkNullCanvas.cpp',
        'utils/SkOSPath.cpp',
        'utils/SkPaintFilterCanvas.cpp',
        'utils/SkParse.cpp',
        'utils/SkParseColor.cpp',
        'utils/SkParsePath.cpp',
        'utils/SkPatchUtils.cpp',
        'utils/SkShadowTessellator.cpp',
        'utils/SkShadowUtils.cpp',
        'utils/SkTextBox.cpp',
        'utils/SkThreadUtils_pthread.cpp',
        'utils/SkWhitelistTypefaces.cpp',

        # xps
        'xps/SkXPSDocument.cpp',
        'xps/SkXPSDevice.cpp',

        # others
        'codec/SkBmpBaseCodec.cpp',
        'codec/SkBmpCodec.cpp',
        'codec/SkBmpMaskCodec.cpp',
        'codec/SkBmpRLECodec.cpp',
        'codec/SkBmpStandardCodec.cpp',
        'codec/SkCodec.cpp',
        'codec/SkCodecImageGenerator.cpp',
        'codec/SkGifCodec.cpp',
        'codec/SkMaskSwizzler.cpp',
        'codec/SkMasks.cpp',
        'codec/SkSampledCodec.cpp',
        'codec/SkSampler.cpp',
        'codec/SkStreamBuffer.cpp',
        'codec/SkSwizzler.cpp',
        'codec/SkWbmpCodec.cpp',
        'images/SkImageEncoder.cpp',
        'ports/SkDiscardableMemory_none.cpp',
        'ports/SkImageGenerator_skia.cpp',
        'ports/SkMemory_malloc.cpp',
        'ports/SkOSFile_stdio.cpp',
        'ports/SkOSFile_posix.cpp',
        'ports/SkTLS_pthread.cpp',
        'sfnt/SkOTTable_name.cpp',
        'sfnt/SkOTUtils.cpp',
        'ports/SkDebug_stdio.cpp',

        # opts
        'opts/SkBlitRow_opts_none.cpp',
        'opts/SkBlitMask_opts_none.cpp',
        'opts/SkBitmapProcState_opts_none.cpp',
        # 'opts/SkBitmapProcState_opts_SSE2.cpp',
        # 'opts/SkBlitRow_opts_SSE2.cpp',
        # 'opts/SkBlitMask_opts_none.cpp',

        # 'opts/SkBitmapProcState_opts_SSSE3.cpp',
        'opts/SkOpts_ssse3.cpp',
        'opts/SkOpts_sse41.cpp',
        'opts/SkOpts_sse42.cpp',
        'opts/SkOpts_avx.cpp',
        # 'opts/opts_check_x86.cpp',

        # effects
        'ports/SkGlobalInitialization_none.cpp',

        # sksl
        'sksl/SkSLCFGGenerator.cpp',
        'sksl/SkSLCompiler.cpp',
        'sksl/SkSLCPPCodeGenerator.cpp',
        'sksl/SkSLGLSLCodeGenerator.cpp',
        'sksl/SkSLHCodeGenerator.cpp',
        'sksl/SkSLIRGenerator.cpp',
        'sksl/SkSLLexer.cpp',
        'sksl/SkSLLayoutLexer.cpp',
        'sksl/SkSLMetalCodeGenerator.cpp',
        'sksl/SkSLParser.cpp',
        'sksl/SkSLSPIRVCodeGenerator.cpp',
        'sksl/SkSLString.cpp',
        'sksl/SkSLUtil.cpp',
        'sksl/ir/SkSLSymbolTable.cpp',
        'sksl/ir/SkSLSetting.cpp',
        'sksl/ir/SkSLType.cpp',
    ]

    if platform & {'linux'}:
        cflags = fontconfig.cflags + freetype.cflags
        ldlibs = fontconfig.ldlibs + freetype.ldlibs

        srcs.extend([
            # fontmgr_fontconfig
            'ports/SkFontConfigInterface.cpp',
            'ports/SkFontConfigInterface_direct.cpp',
            'ports/SkFontConfigInterface_direct_factory.cpp',
            'ports/SkFontMgr_FontConfigInterface.cpp',
            'ports/SkFontMgr_fontconfig.cpp',
            'ports/SkFontMgr_fontconfig_factory.cpp',

            # freetype
            'ports/SkFontHost_FreeType.cpp',
            'ports/SkFontHost_FreeType_common.cpp',
        ])
    elif platform & {'macosx'}:
        cflags = ldlibs = []

        srcs.extend([
            # utils
            'utils/mac/SkCreateCGImageRef.cpp',
            'utils/mac/SkStream_mac.cpp',

            # fonts
            'ports/SkFontHost_mac.cpp',
        ])

    sources = skia_sources(*srcs)
    sources.append('deps/skia/third_party/gif/SkGifImageReader.cpp')

    public_includes = Path.glob('deps/skia/include/*')
    lib = cxx.build_lib('skia', sources, macros=['SK_SUPPORT_GPU=0'],
                        includes=Path.glob('deps/skia/src/*') + public_includes + \
                                 ['deps/skia/third_party/gif'], cflags=cflags)
    return Record(includes=public_includes, lib=lib, ldlibs=ldlibs)
Пример #49
0
def test(ctx):
    rec = build(ctx)

    for test in Path.glob('tests/*.input.desktop'):
        run_test(ctx, rec, test.replaceext('').replaceext('').basename())
Пример #50
0
def build_flx_misc(phase):
    path = Path('src/compiler/flx_misc')
    return phase.ocaml.build_lib(path / 'flx_misc',
                                 srcs=Path.glob(path / '*.ml{,i}'),
                                 libs=[build_flx_version(phase)],
                                 external_libs=['str', 'unix'])
Пример #51
0
def build(phase, felix):

    
    # The wiki is killing the compiler, inlining procedure
    # cannot cope. Possible inline explosion.
    # Need to investigate this. Maybe its too big,
    # and maybe the small change I just introduced was enough
    # to kill it.

    #try:
    #    exe = felix.compile(phase.ctx.buildroot/'wiki/wiki.flx', static=True)
    #    fbuild.builders.file.copy(phase.ctx, exe, 'bin')
    #except:
    #    print("Warning : wiki not built. Continuing..." )

    for f in Path.glob('src/lib/plugins/*'):
      copy(ctx=phase.ctx, src=f, dst=phase.ctx.buildroot / f[4:]) 

    exes = [
      "flx_grep",
      "flx_replace",
      "flx_ls",
      "flx_cp",
      "webserver",
      "flx_gramdoc",
      "flx_libcontents",
      "flx_libindex",
      "flx_renumber",
      "flx_mktutindex",
      "flx_perror",
      "flx_tangle",
      "flx_gengraph",
      "flx_testpack",
      ]

    optional_exes = [
      "norK",
      ]

    for base in exes:
      exe = felix.compile(phase.ctx.buildroot/('tools/'+base+'.flx'), 
        static=True,
        includes=[phase.ctx.buildroot/'lib'/'plugins'])
      fbuild.builders.file.copy(phase.ctx, exe, 'bin')

    for base in optional_exes:
      try:
          exe = felix.compile(phase.ctx.buildroot/('tools/'+base+'.flx'), 
            static=True,
            includes=[phase.ctx.buildroot/'lib'/'plugins'])
          fbuild.builders.file.copy(phase.ctx, exe, 'bin')
      except:
          print("Warning : "+base+" not built. Continuing..." )


    try:
      os.mkdir(phase.ctx.buildroot/'shlib')
    except:
      pass

    plugins = [
      "ocaml2html",
      "py2html",
      "fdoc2html",
      "flx2html",
      "cpp2html",
      "fpc2html",
      "fdoc_slideshow",
      "fdoc_paragraph",
      "fdoc_heading",
      "fdoc_fileseq",
      "fdoc_scanner",
      "fdoc_button",
      "toolchain_clang_osx",
      "toolchain_clang_linux",
      "toolchain_gcc_osx",
      "toolchain_gcc_linux",
      ]
    for base in plugins:
      shlib = felix.compile(phase.ctx.buildroot/('lib/plugins/'+base+'.flx'))
      fbuild.builders.file.copy(phase.ctx, shlib, 'shlib')
Пример #52
0
def build_flx_version_hook(phase):
    path = phase.ctx.buildroot / 'src/compiler/flx_version_hook'
    return phase.ocaml.build_lib(path / 'flx_version_hook',
        srcs=Path.glob(path / '*.ml{,i}'),
        libs=[build_flx_version(phase)])
Пример #53
0
def build_runtime(host_phase, target_phase):
    path = Path('src', 'rtl')

    buildsystem.copy_hpps_to_rtl(
        target_phase.ctx,
        path / 'flx_rtl.hpp',
        path / 'flx_rtl_shapes.hpp',
        path / 'flx_compiler_support_headers.hpp',
        path / 'flx_compiler_support_bodies.hpp',
        path / 'flx_dynlink.hpp',
        path / 'flx_i18n.hpp',
        path / 'flx_ioutil.hpp',
        path / 'flx_strutil.hpp',
        path / 'flx_executil.hpp',
        path / 'flx_sync.hpp',
        path / 'flx_world.hpp',
        path / 'flx_async_world.hpp',
        path / 'flx_world_config.hpp',
        path / 'plat_linux.hpp',
    )

    for f in Path.glob(path / "*.hpp"):
        print("Copying " + f + " --> " + target_phase.ctx.buildroot / f)
        copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f)

    srcs = [
        copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f)
        for f in Path.glob(path / '*.cpp')
    ]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl'
    ]
    macros = ['BUILD_RTL']
    libs = [
        call('buildsystem.flx_async.build_runtime', host_phase, target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_gc.build_runtime', host_phase, target_phase),
    ]

    dlfcn_h = config_call('fbuild.config.c.posix.dlfcn_h',
                          target_phase.platform, target_phase.cxx.static,
                          target_phase.cxx.shared)

    if dlfcn_h.dlopen:
        external_libs = dlfcn_h.external_libs
    else:
        external_libs = []

    dst = 'host/lib/rtl/flx'
    return Record(static=buildsystem.build_cxx_static_lib(
        target_phase,
        dst,
        srcs,
        includes=includes,
        macros=macros,
        libs=[lib.static for lib in libs],
        external_libs=external_libs),
                  shared=buildsystem.build_cxx_shared_lib(
                      target_phase,
                      dst,
                      srcs,
                      includes=includes,
                      macros=macros,
                      libs=[lib.shared for lib in libs],
                      external_libs=external_libs))
Пример #54
0
def build_runtime(host_phase, target_phase):
    path = Path('src/gc')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_gc.hpp',
        path / 'flx_judy_scanner.hpp',
        path / 'flx_serialisers.hpp',
        path / 'flx_collector.hpp',
        path / 'flx_gc_private.hpp',
        path / 'flx_ts_collector.hpp',
        path / 'pthread_bound_queue.hpp',
        path / 'pthread_work_fifo.hpp',
    )

    dst = 'lib/rtl/flx_gc'
    srcs = [copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f) for f in Path.glob(path / '*.cpp')]
    includes = [
        target_phase.ctx.buildroot / 'config/target',
        target_phase.ctx.buildroot / 'lib/rtl',
        'src/rtl',
        'src/pthread',
        'src/exceptions',
        'src/judy/src',
    ]
    macros = ['BUILD_FLX_GC']
    libs = [
        call('buildsystem.judy.build_runtime', host_phase, target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_pthread.build_runtime', target_phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs]),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs]))
Пример #55
0
def build_runtime(host_phase, target_phase):
    path = Path('src/gc')

    buildsystem.copy_hpps_to_rtl(target_phase.ctx,
        path / 'flx_gc.hpp',
        path / 'flx_judy_scanner.hpp',
        path / 'flx_serialisers.hpp',
        path / 'flx_collector.hpp',
        path / 'flx_gc_private.hpp',
        path / 'flx_ts_collector.hpp',
        path / 'pthread_bound_queue.hpp',
        path / 'pthread_work_fifo.hpp',
    )

    dst = 'host/lib/rtl/flx_gc'
    srcs = [copy(ctx=target_phase.ctx, src=f, dst=target_phase.ctx.buildroot / f) for f in Path.glob(path / '*.cpp')]
    includes = [
        target_phase.ctx.buildroot / 'host/lib/rtl',
        target_phase.ctx.buildroot / 'share/lib/rtl',
        'src/rtl',
        'src/pthread',
        'src/exceptions',
        'src/judy/src',
    ]
    macros = ['BUILD_FLX_GC']
    libs = [
        call('buildsystem.judy.build_runtime', host_phase, target_phase),
        call('buildsystem.flx_exceptions.build_runtime', target_phase),
        call('buildsystem.flx_pthread.build_runtime', target_phase),
    ]

    return Record(
        static=buildsystem.build_cxx_static_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.static for lib in libs]),
        shared=buildsystem.build_cxx_shared_lib(target_phase, dst, srcs,
            includes=includes,
            macros=macros,
            libs=[lib.shared for lib in libs]))