diff options
author | Mike Klein <mtklein@google.com> | 2017-06-27 22:52:03 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-27 22:52:10 +0000 |
commit | 5ce397205528f82084fc650c2ce27d246c01da33 (patch) | |
tree | 3e359ae172fed10fce8204163d6d372b0c3f6207 /gn/BUILD.gn | |
parent | 3fe44544c93759e7791ee0df3e5d172cb0f268b6 (diff) |
Revert "Re-land sksl fragment processor support"
This reverts commit c070939fd1a954b7a492bc30f0cf64a664b90181.
Reason for revert:
This has some knock-on effects in the generation of Android.bp from our GN files. See gn/gn_to_bp.py? We're seeing things like "tmp/tmpsBVycx/gen/" end up in the include search path in Android.bp, which obviously don't exist there...
Original change's description:
> Re-land sksl fragment processor support
>
> This reverts commit ed50200682e0de72c3abecaa4d5324ebcd1ed9f9.
>
> Bug: skia:
> Change-Id: I9caa7454b391450620d6989dc472abb3cf7a2cab
> Reviewed-on: https://skia-review.googlesource.com/20965
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=benjaminwagner@google.com,ethannicholas@google.com
Change-Id: I502486b5405923b322429219f4cc396a45a14cea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20990
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'gn/BUILD.gn')
-rw-r--r-- | gn/BUILD.gn | 278 |
1 files changed, 278 insertions, 0 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index d275bd6685..fdd50b1a11 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -4,14 +4,48 @@ # found in the LICENSE file. declare_args() { + ar = "ar" + cc = "cc" + cxx = "c++" + + if (is_android) { + if (host_os == "win") { + ar = "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin/ar.exe" + cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang.exe" + cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++.exe" + } else { + ar = "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin/ar" + cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang" + cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++" + } + } + + msvc = 2015 + extra_asmflags = [] extra_cflags = [] extra_cflags_c = [] extra_cflags_cc = [] extra_ldflags = [] + cc_wrapper = "" malloc = "" } +declare_args() { + if (msvc == 2015) { + windk = "C:/Program Files (x86)/Microsoft Visual Studio 14.0" + } else { + windk = "C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional" + } +} + +if (host_os == "win") { + python = "python.bat" + stamp = "cmd.exe /c echo >" +} else { + python = "python" + stamp = "touch" +} is_clang = is_android || is_ios || is_mac || (cc == "clang" && cxx == "clang++") if (!is_clang && !is_win) { @@ -439,3 +473,247 @@ config("executable") { ] } } + +toolchain("msvc") { + lib_dir_switch = "/LIBPATH:" + + if (msvc == 2015) { + bin = "$windk/VC/bin/amd64" + env_setup = "" + if (target_cpu == "x86") { + bin += "_x86" + env_setup = "cmd /c $windk/win_sdk/bin/SetEnv.cmd /x86 && " + } + } else { + bin = "$windk/VC/Tools/MSVC/14.10.25017/bin/HostX64/$target_cpu" + env_setup = "" + if (target_cpu == "x86") { + print("Be sure to run") + print("$windk/VC/Auxiliary/Build/vcvarsall.bat amd64_x86") + print("to set up your environment before running ninja.") + } + } + + tool("asm") { + _ml = "ml" + if (target_cpu == "x64") { + _ml += "64" + } + command = "$env_setup$bin/$_ml.exe /nologo /c /Fo {{output}} {{source}}" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", + ] + description = "assemble {{source}}" + } + + tool("cc") { + rspfile = "{{output}}.rsp" + precompiled_header_type = "msvc" + pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb" + + # Label names may have spaces so pdbname must be quoted. + command = "$env_setup$bin/cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" + depsformat = "msvc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", + ] + rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_c}}" + description = "compile {{source}}" + } + + tool("cxx") { + rspfile = "{{output}}.rsp" + precompiled_header_type = "msvc" + pdbname = "{{target_out_dir}}/{{label_name}}_c.pdb" + + # Label names may have spaces so pdbname must be quoted. + command = "$env_setup$bin/cl.exe /nologo /showIncludes /FC @$rspfile /c {{source}} /Fo{{output}} /Fd\"$pdbname\"" + depsformat = "msvc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj", + ] + rspfile_content = "{{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}" + description = "compile {{source}}" + } + + tool("alink") { + rspfile = "{{output}}.rsp" + + command = "$env_setup$bin/lib.exe /nologo /ignore:4221 {{arflags}} /OUT:{{output}} @$rspfile" + outputs = [ + # Ignore {{output_extension}} and always use .lib, there's no reason to + # allow targets to override this extension on Windows. + "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", + ] + default_output_extension = ".lib" + default_output_dir = "{{target_out_dir}}" + + # inputs_newline works around a fixed per-line buffer size in the linker. + rspfile_content = "{{inputs_newline}}" + description = "link {{output}}" + } + + tool("solink") { + dllname = "{{output_dir}}/{{target_output_name}}{{output_extension}}" + libname = "${dllname}.lib" + pdbname = "${dllname}.pdb" + rspfile = "${dllname}.rsp" + + command = "$env_setup$bin/link.exe /nologo /IMPLIB:$libname /DLL /OUT:$dllname /PDB:$pdbname @$rspfile" + outputs = [ + dllname, + libname, + pdbname, + ] + default_output_extension = ".dll" + default_output_dir = "{{root_out_dir}}" + + link_output = libname + depend_output = libname + runtime_outputs = [ + dllname, + pdbname, + ] + + # I don't quite understand this. Aping Chrome's toolchain/win/BUILD.gn. + restat = true + + # inputs_newline works around a fixed per-line buffer size in the linker. + rspfile_content = "{{inputs_newline}} {{libs}} {{solibs}} {{ldflags}}" + description = "link {{output}}" + } + + tool("link") { + exename = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" + pdbname = "$exename.pdb" + rspfile = "$exename.rsp" + + command = + "$env_setup$bin/link.exe /nologo /OUT:$exename /PDB:$pdbname @$rspfile" + + default_output_extension = ".exe" + default_output_dir = "{{root_out_dir}}" + outputs = [ + exename, + ] + + # inputs_newline works around a fixed per-line buffer size in the linker. + rspfile_content = "{{inputs_newline}} {{libs}} {{solibs}} {{ldflags}}" + description = "link {{output}}" + } + + tool("stamp") { + command = "$stamp {{output}}" + description = "stamp {{output}}" + } + + tool("copy") { + cp_py = rebase_path("cp.py") + command = "$python $cp_py {{source}} {{output}}" + description = "copy {{source}} {{output}}" + } +} + +toolchain("gcc_like") { + lib_switch = "-l" + lib_dir_switch = "-L" + + tool("cc") { + depfile = "{{output}}.d" + command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" + depsformat = "gcc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + ] + description = "compile {{source}}" + } + + tool("cxx") { + depfile = "{{output}}.d" + command = "$cc_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" + depsformat = "gcc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + ] + description = "compile {{source}}" + } + + tool("objc") { + depfile = "{{output}}.d" + command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objc}} -c {{source}} -o {{output}}" + depsformat = "gcc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + ] + description = "compile {{source}}" + } + + tool("objcxx") { + depfile = "{{output}}.d" + command = "$cc_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} {{cflags_objc}} -c {{source}} -o {{output}}" + depsformat = "gcc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + ] + description = "compile {{source}}" + } + + tool("asm") { + depfile = "{{output}}.d" + command = "$cc_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}" + depsformat = "gcc" + outputs = [ + "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", + ] + description = "assemble {{source}}" + } + + tool("alink") { + rspfile = "{{output}}.rsp" + rspfile_content = "{{inputs}}" + ar_py = rebase_path("ar.py") + command = "$python $ar_py $ar {{output}} $rspfile" + outputs = [ + "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", + ] + default_output_extension = ".a" + output_prefix = "lib" + description = "link {{output}}" + } + + tool("solink") { + soname = "{{target_output_name}}{{output_extension}}" + + rpath = "-Wl,-soname,$soname" + if (is_mac) { + rpath = "-Wl,-install_name,@rpath/$soname" + } + + command = "$cc_wrapper $cxx -shared {{ldflags}} {{inputs}} {{solibs}} {{libs}} $rpath -o {{output}}" + outputs = [ + "{{root_out_dir}}/$soname", + ] + output_prefix = "lib" + default_output_extension = ".so" + description = "link {{output}}" + } + + tool("link") { + command = "$cc_wrapper $cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}} -o {{output}}" + outputs = [ + "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", + ] + description = "link {{output}}" + } + + tool("stamp") { + command = "$stamp {{output}}" + description = "stamp {{output}}" + } + + tool("copy") { + cp_py = rebase_path("cp.py") + command = "$python $cp_py {{source}} {{output}}" + description = "copy {{source}} {{output}}" + } +} |