diff options
author | Kevin Lubick <kjlubick@google.com> | 2017-09-21 13:45:16 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-21 18:24:43 +0000 |
commit | ebf648e57afa0484b4665b2c945331e1af0dfb83 (patch) | |
tree | 8d45c7834e8f5933cb22f4db2b9d1af3297e6ccc /gn | |
parent | 5e996b85dbfe016af4160acd70e110689b10c2d9 (diff) |
[WASM] Add POC compile bot for WebAssembly
Fix core.gni to use not use Assembler for none cpu.
Right now, there are no outputs because we aren't compiling
dm or nanobench. However, this still compiles the skia
library and creates two executables, so it's a good canary
for a real WASM build.
Additional note: the two executables in question don't draw
anything to the screen via GL, which is still not possible with
Skia+WASM.
Bug: skia:
Change-Id: I0d767467e94e40d01070e34223dd90e96f1c96f2
Reviewed-on: https://skia-review.googlesource.com/49540
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Eric Boren <borenet@google.com>
Diffstat (limited to 'gn')
-rw-r--r-- | gn/BUILD.gn | 7 | ||||
-rw-r--r-- | gn/BUILDCONFIG.gn | 7 | ||||
-rw-r--r-- | gn/core.gni | 3 |
3 files changed, 15 insertions, 2 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn index b91c8770e7..5d17cade50 100644 --- a/gn/BUILD.gn +++ b/gn/BUILD.gn @@ -438,6 +438,13 @@ config("release") { } else { ldflags = [ "-Wl,--gc-sections" ] } + if (target_cpu == "wasm") { + # The compiler asks us to add an optimization flag to both cflags + # and ldflags to cut down on the local variables, + # for performance reasons. + # The "linking" step is the conversion to javascript. + ldflags += [ "-O3" ] + } } defines = [ "NDEBUG" ] } diff --git a/gn/BUILDCONFIG.gn b/gn/BUILDCONFIG.gn index ca91c1bcb3..057bea1faf 100644 --- a/gn/BUILDCONFIG.gn +++ b/gn/BUILDCONFIG.gn @@ -37,6 +37,10 @@ declare_args() { assert(!(is_debug && is_official_build)) +if (target_cpu == "wasm") { + target_os = "wasm" +} + # Platform detection if (target_os == "") { target_os = host_os @@ -69,7 +73,8 @@ if (current_cpu == "") { current_cpu = target_cpu } -is_clang = is_android || is_ios || is_mac || (cc == "clang" && cxx == "clang++") || clang_win != "" +is_clang = is_android || is_ios || is_mac || + (cc == "clang" && cxx == "clang++") || clang_win != "" if (!is_clang && !is_win) { is_clang = exec_script("gn/is_clang.py", [ diff --git a/gn/core.gni b/gn/core.gni index eb0d0d2eaf..79498b460b 100644 --- a/gn/core.gni +++ b/gn/core.gni @@ -530,6 +530,7 @@ if (is_win) { # assembler situation is figured out, https://crbug.com/762167 skia_core_defines += [ "SK_JUMPER_USE_ASSEMBLY=0" ] } -} else { +} else if (target_cpu == "arm" || target_cpu == "arm64" || + target_cpu == "x86" || target_cpu == "x64") { skia_core_sources += [ "$_src/jumper/SkJumper_generated.S" ] } |