Skip to content

Commit 166cd52

Browse files
Mike KleinSkia Commit-Bot
authored andcommitted
move conditions for JIT into SkVM.h
This makes it easier to keep in sync with the implementation in SkVM.cpp, and it's easier to handle here once than in each build system. Change-Id: I429f90cfc16f35a0d7e0b0fde176bc013aa7db18 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310263 Commit-Queue: Mike Klein <[email protected]> Commit-Queue: Herb Derby <[email protected]> Auto-Submit: Mike Klein <[email protected]> Reviewed-by: Herb Derby <[email protected]>
1 parent 17fd901 commit 166cd52

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,8 @@ optional("sksl_interpreter") {
10161016
}
10171017

10181018
optional("skvm_jit") {
1019-
enabled = skia_enable_skvm_jit
1020-
public_defines = [ "SKVM_JIT" ]
1019+
enabled = skia_enable_skvm_jit_when_possible
1020+
public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
10211021
if (skia_vtune_path != "") {
10221022
public_defines += [ "SKVM_JIT_VTUNE" ]
10231023
public_include_dirs = [ "$skia_vtune_path/include" ]

gn/skia.gni

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ declare_args() {
2525
skia_enable_skottie = !(is_win && is_component_build)
2626
skia_enable_skrive = true
2727
skia_enable_sksl_interpreter = is_skia_dev_build
28-
skia_enable_skvm_jit =
29-
is_skia_dev_build &&
30-
((target_cpu == "x64" && (is_linux || is_mac || is_win)) ||
31-
(target_cpu == "arm64" && is_android))
28+
skia_enable_skvm_jit_when_possible = is_skia_dev_build
3229
skia_enable_tools = is_skia_dev_build
3330
skia_enable_gpu_debug_layers = is_skia_dev_build && is_debug
3431
skia_generate_workarounds = false

src/core/SkVM.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@
1919

2020
class SkWStream;
2121

22+
#if defined(SKVM_JIT_WHEN_POSSIBLE)
23+
#if defined(__x86_64__) || defined(_M_X64)
24+
#if defined(_WIN32) || defined(__linux) || defined(__APPLE__)
25+
#define SKVM_JIT
26+
#endif
27+
#endif
28+
#if defined(__aarch64__)
29+
#if defined(__ANDROID__)
30+
#define SKVM_JIT
31+
#endif
32+
#endif
33+
#endif
34+
2235
#if 0
2336
#define SKVM_LLVM
2437
#endif

0 commit comments

Comments
 (0)