Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / gn / BUILDCONFIG.gn
1 # Copyright 2016 Google Inc.
2 #
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 is_skia_standalone = true
7
8 # It's best to keep the names and defaults of is_foo flags consistent with Chrome.
9
10 declare_args() {
11   is_official_build = false
12   is_component_build = false
13   ndk = ""
14
15   # Android 5.0, Lollipop
16   ndk_api = 21
17
18   sanitize = ""
19
20   ar = "ar"
21   cc = "cc"
22   cxx = "c++"
23
24   win_sdk = "C:/Program Files (x86)/Windows Kits/10"
25   win_sdk_version = ""
26
27   win_vc = ""
28   win_toolchain_version = ""
29
30   clang_win = ""
31   clang_win_version = ""
32
33   ios_min_target = ""
34   ios_use_simulator =
35       target_os == "ios" && (target_cpu == "x86" || target_cpu == "x64")
36 }
37 declare_args() {
38   is_debug = !is_official_build
39 }
40
41 assert(!(is_debug && is_official_build))
42
43 if (target_cpu == "wasm") {
44   target_os = "wasm"
45 }
46
47 # Platform detection
48 if (target_os == "") {
49   target_os = host_os
50   if (ndk != "") {
51     target_os = "android"
52   }
53 }
54 if (current_os == "") {
55   current_os = target_os
56 }
57
58 is_android = current_os == "android"
59 is_fuchsia = current_os == "fuchsia"
60 is_ios = current_os == "ios" || current_os == "tvos"
61 is_tvos = current_os == "tvos"
62 is_linux = current_os == "linux"
63 is_mac = current_os == "mac"
64 is_wasm = current_os == "wasm"
65 is_win = current_os == "win"
66
67 # This is just to make the Dawn build files happy. Skia itself uses target_os = "linux"
68 # for ChromeOS, so this variable will not affect Skia proper.
69 is_chromeos = false
70
71 # This is to make the ANGLE build files happy. Skia always uses is_mac and/or is_ios.
72 is_apple = is_mac || is_ios
73
74 if (target_cpu == "") {
75   target_cpu = host_cpu
76   if (is_android || is_ios) {
77     target_cpu = "arm64"
78   }
79 }
80 if (target_cpu == "x86_64") {
81   target_cpu = "x64"
82 }
83 if (current_cpu == "") {
84   current_cpu = target_cpu
85 }
86
87 is_clang = is_android || is_ios || is_mac || is_fuchsia || is_wasm ||
88            (cc == "clang" && cxx == "clang++") || clang_win != ""
89 if (!is_clang && !is_win) {
90   is_clang = exec_script("//gn/is_clang.py",
91                          [
92                            cc,
93                            cxx,
94                          ],
95                          "value")
96 }
97
98 if (is_android) {
99   ndk_host = ""
100   ndk_target = ""
101   ndk_gdbserver = ""
102
103   if (host_os == "linux") {
104     ndk_host = "linux-x86_64"
105   } else if (host_os == "mac") {
106     ndk_host = "darwin-x86_64"
107   } else if (host_os == "win") {
108     ndk_host = "windows-x86_64"
109   }
110
111   if (target_cpu == "arm64") {
112     ndk_target = "aarch64-linux-android"
113     ndk_gdbserver = "prebuilt/android-arm64/gdbserver/gdbserver"
114   } else if (target_cpu == "arm") {
115     ndk_target = "armv7a-linux-androideabi"
116     ndk_gdbserver = "prebuilt/android-arm/gdbserver/gdbserver"
117   } else if (target_cpu == "x64") {
118     ndk_target = "x86_64-linux-android"
119     ndk_gdbserver = "prebuilt/android-x86_64/gdbserver/gdbserver"
120   } else if (target_cpu == "x86") {
121     ndk_target = "i686-linux-android"
122     ndk_gdbserver = "prebuilt/android-x86/gdbserver/gdbserver"
123   }
124 }
125
126 if (target_os == "win") {
127   # By default we look for 2017 (Enterprise, Pro, and Community), then 2015. If MSVC is installed in a
128   # non-default location, you can set win_vc to inform us where it is.
129
130   if (win_vc == "") {
131     win_vc = exec_script("//gn/find_msvc.py", [], "trim string")
132   }
133   assert(win_vc != "")  # Could not find VC installation. Set win_vc to your VC
134                         # directory.
135 }
136
137 if (target_os == "win") {
138   if (win_toolchain_version == "") {
139     win_toolchain_version = exec_script("//gn/highest_version_dir.py",
140                                         [
141                                           "$win_vc/Tools/MSVC",
142                                           "[0-9]{2}\.[0-9]{2}\.[0-9]{5}",
143                                         ],
144                                         "trim string")
145   }
146   if (win_sdk_version == "") {
147     win_sdk_version = exec_script("//gn/highest_version_dir.py",
148                                   [
149                                     "$win_sdk/Include",
150                                     "[0-9]{2}\.[0-9]\.[0-9]{5}\.[0-9]",
151                                   ],
152                                   "trim string")
153   }
154   if (clang_win != "" && clang_win_version == "") {
155     clang_win_version = exec_script("//gn/highest_version_dir.py",
156                                     [
157                                       "$clang_win/lib/clang",
158                                       "[0-9]+\.[0-9]+\.[0-9]+",
159                                     ],
160                                     "trim string")
161   }
162 }
163
164 # A component is either a static or a shared library.
165 template("component") {
166   _component_mode = "static_library"
167   if (is_component_build) {
168     _component_mode = "shared_library"
169   }
170
171   target(_component_mode, target_name) {
172     forward_variables_from(invoker, "*")
173   }
174 }
175
176 # Default configs
177 default_configs = [
178   "//gn/skia:default",
179   "//gn/skia:no_exceptions",
180   "//gn/skia:no_rtti",
181 ]
182 if (!is_debug) {
183   default_configs += [
184     "//gn/skia:optimize",
185     "//gn/skia:NDEBUG",
186   ]
187 }
188 if (!is_official_build) {
189   default_configs += [ "//gn/skia:debug_symbols" ]
190 }
191 default_configs += [ "//gn/skia:extra_flags" ]
192
193 set_defaults("executable") {
194   configs = [ "//gn/skia:executable" ] + default_configs
195 }
196
197 set_defaults("source_set") {
198   configs = default_configs
199 }
200
201 set_defaults("static_library") {
202   configs = default_configs
203 }
204
205 set_defaults("shared_library") {
206   configs = default_configs
207 }
208
209 set_defaults("component") {
210   configs = default_configs
211   if (!is_component_build) {
212     complete_static_lib = true
213   }
214 }
215
216 skia_target_default_configs = []
217 if (!is_official_build) {
218   skia_target_default_configs += [ "//gn/skia:warnings" ]
219 }
220
221 skia_header_target_default_configs = []
222 if (!is_official_build) {
223   skia_header_target_default_configs +=
224       [ "//gn/skia:warnings_for_public_headers" ]
225 }
226
227 if (is_win) {
228   # Windows tool chain
229   set_default_toolchain("//gn/toolchain:msvc")
230   default_toolchain_name = "msvc"
231   host_toolchain = "msvc"
232 } else if (is_wasm) {
233   set_default_toolchain("//gn/toolchain:wasm")
234   default_toolchain_name = "wasm"
235   host_toolchain = "wasm"
236 } else {
237   # GCC-like toolchains, including Clang.
238   set_default_toolchain("//gn/toolchain:gcc_like")
239   default_toolchain_name = "gcc_like"
240   host_toolchain = "gcc_like_host"
241 }