9 skia_dir = checkout_root.join(
'skia')
10 configuration = api.vars.builder_cfg.get(
'configuration')
11 target_arch = api.vars.builder_cfg.get(
'target_arch')
13 top_level = str(api.vars.workdir)
15 clang_linux = os.path.join(top_level,
'clang_linux')
17 sysroot_dir = os.path.join(top_level,
'armhf_sysroot')
20 'cc':
"%s" % os.path.join(clang_linux,
'bin',
'clang'),
21 'cxx':
"%s" % os.path.join(clang_linux,
'bin',
'clang++'),
24 'extra_asmflags' : [],
25 'target_cpu': target_arch,
26 'skia_use_fontconfig':
False,
27 'skia_use_system_freetype2':
False,
32 if 'arm' == target_arch:
35 gl_dir = os.path.join(top_level,
'chromebook_arm_gles')
36 env = {
'LD_LIBRARY_PATH': os.path.join(sysroot_dir,
'lib')}
37 args[
'extra_asmflags'] = [
38 '--target=armv7a-linux-gnueabihf',
39 '--sysroot=%s' % sysroot_dir,
45 args[
'extra_cflags'] = [
46 '--target=armv7a-linux-gnueabihf',
47 '--sysroot=%s' % sysroot_dir,
48 '-I%s' % os.path.join(gl_dir,
'include'),
49 '-I%s' % os.path.join(sysroot_dir,
'include'),
50 '-I%s' % os.path.join(sysroot_dir,
'include',
'c++',
'10'),
51 '-I%s' % os.path.join(sysroot_dir,
'include',
'c++',
'10',
'arm-linux-gnueabihf'),
52 '-DMESA_EGL_NO_X11_HEADERS',
56 args[
'extra_ldflags'] = [
57 '--target=armv7a-linux-gnueabihf',
58 '--sysroot=%s' % sysroot_dir,
59 '-static-libstdc++',
'-static-libgcc',
61 '-B%s' % os.path.join(sysroot_dir,
'bin'),
63 '-B%s' % os.path.join(sysroot_dir,
'gcc-cross'),
65 '-L%s' % os.path.join(sysroot_dir,
'gcc-cross'),
66 '-L%s' % os.path.join(sysroot_dir,
'lib'),
67 '-L%s' % os.path.join(gl_dir,
'lib'),
70 gl_dir = os.path.join(top_level,
'chromebook_x86_64_gles')
72 args[
'extra_asmflags'] = []
73 args[
'extra_cflags'] = [
74 '-DMESA_EGL_NO_X11_HEADERS',
75 '-I%s' % os.path.join(gl_dir,
'include'),
77 args[
'extra_ldflags'] = [
78 '-L%s' % os.path.join(gl_dir,
'lib'),
79 '-static-libstdc++',
'-static-libgcc',
83 args[
'extra_cflags'].
append(
'-DREBUILD_IF_CHANGED_clang_linux_version=%s' %
84 api.run.asset_version(
'clang_linux', skia_dir))
86 if configuration !=
'Debug':
87 args[
'is_debug'] =
False
89 gn = skia_dir.join(
'bin',
'gn')
91 with api.context(cwd=skia_dir, env=env):
92 api.run(api.step,
'fetch-gn',
93 cmd=[
'python3', skia_dir.join(
'bin',
'fetch-gn')],
95 api.run(api.step,
'fetch-ninja',
96 cmd=[
'python3', skia_dir.join(
'bin',
'fetch-ninja')],
98 api.run(api.step,
'gn gen',
99 cmd=[gn,
'gen', out_dir,
'--args=' + util.py_to_gn(args)])
100 api.run(api.step,
'ninja',
101 cmd=[
'ninja',
'-C', out_dir,
'nanobench',
'dm'])
105 util.copy_listed_files(api, src, dst, util.DEFAULT_BUILD_PRODUCTS)
static void append(char **dst, size_t *count, const char *src, size_t n)
def copy_build_products(api, src, dst)
def compile_fn(api, checkout_root, out_dir)