• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are met:
5#
6#   * Redistributions of source code must retain the above copyright notice,
7#     this list of conditions and the following disclaimer.
8#   * Redistributions in binary form must reproduce the above copyright notice,
9#     this list of conditions and the following disclaimer in the documentation
10#     and/or other materials provided with the distribution.
11#   * Neither the name of ARM Limited nor the names of its contributors may be
12#     used to endorse or promote products derived from this software without
13#     specific prior written permission.
14#
15# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS CONTRIBUTORS "AS IS" AND
16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
26import("//arkcompiler/runtime_core/static_core/ark_config.gni")
27import("//build/ohos.gni")
28
29config("vixl_public_config") {
30  defines = []
31  if (is_debug) {
32    defines += [ "VIXL_DEBUG" ]
33  }
34
35  if (defined(vixl_with_panda)) {
36    defines += [ "PANDA_BUILD" ]
37  }
38
39  if (ark_standalone_build) {
40    cflags_cc = [ "-Wno-bitwise-instead-of-logical" ]
41  }
42
43  include_dirs = [
44    "$ark_third_party_root/vixl",
45    "$ark_third_party_root/vixl/src",
46  ]
47  if (target_cpu == "arm") {
48    include_dirs += [ "$ark_third_party_root/vixl/src/aarch32" ]
49  } else if (target_cpu == "arm64" || target_cpu == "amd64" ||
50             target_cpu == "x64" || target_cpu == "x86_64") {
51    include_dirs += [ "$ark_third_party_root/vixl/src/aarch64" ]
52  }
53}
54
55ohos_static_library("libvixl") {
56  sources = [
57    "src/code-buffer-vixl.cc",
58    "src/compiler-intrinsics-vixl.cc",
59    "src/cpu-features.cc",
60    "src/utils-vixl.cc",
61  ]
62
63  if (target_cpu == "arm") {
64    sources += [
65      "src/aarch32/assembler-aarch32.cc",
66      "src/aarch32/constants-aarch32.cc",
67      "src/aarch32/disasm-aarch32.cc",
68      "src/aarch32/instructions-aarch32.cc",
69      "src/aarch32/location-aarch32.cc",
70      "src/aarch32/macro-assembler-aarch32.cc",
71      "src/aarch32/operands-aarch32.cc",
72    ]
73    cflags_cc = [ "-DVIXL_INCLUDE_TARGET_A32" ]
74  } else if (target_cpu == "arm64" || target_cpu == "amd64" ||
75             target_cpu == "x64" || target_cpu == "x86_64") {
76    sources += [
77      "src/aarch64/assembler-aarch64.cc",
78      "src/aarch64/assembler-sve-aarch64.cc",
79      "src/aarch64/cpu-aarch64.cc",
80      "src/aarch64/cpu-features-auditor-aarch64.cc",
81      "src/aarch64/decoder-aarch64.cc",
82      "src/aarch64/disasm-aarch64.cc",
83      "src/aarch64/instructions-aarch64.cc",
84      "src/aarch64/logic-aarch64.cc",
85      "src/aarch64/macro-assembler-aarch64.cc",
86      "src/aarch64/macro-assembler-sve-aarch64.cc",
87      "src/aarch64/operands-aarch64.cc",
88      "src/aarch64/pointer-auth-aarch64.cc",
89      "src/aarch64/simulator-aarch64.cc",
90    ]
91    cflags_cc = [
92      "-DVIXL_INCLUDE_TARGET_A64",
93      "-DVIXL_INCLUDE_SIMULATOR_AARCH64",
94    ]
95  } else {
96    cflags_cc = []
97  }
98
99  if (is_mac) {
100    cflags_cc += [ "-DVIXL_CODE_BUFFER_MALLOC" ]
101  } else {
102    cflags_cc += [ "-DVIXL_CODE_BUFFER_MMAP" ]
103  }
104
105  configs = [ "$ark_root:ark_config" ]
106
107  public_configs = [ ":vixl_public_config" ]
108
109  subsystem_name = "thirdparty"
110  part_name = "vixl"
111}
112