if (component_mode == "shared_library") {
defines = [
+ "V8_SHARED",
"BUILDING_V8_SHARED",
+ ]
+ }
+}
+
+# This config should only be applied to code using V8 and not any V8 code
+# itself.
+config("external_config") {
+ if (is_component_build) {
+ defines = [
"V8_SHARED",
+ "USING_V8_SHARED",
]
}
+ include_dirs = [ "include" ]
}
config("features") {
# Executables
#
-executable("mksnapshot") {
- visibility = ":*" # Only targets in this file can depend on this.
+if (current_toolchain == host_toolchain) {
+ executable("mksnapshot") {
+ visibility = ":*" # Only targets in this file can depend on this.
- sources = [
- "src/mksnapshot.cc",
- ]
-
- configs -= [ "//build/config/compiler:chromium_code" ]
- configs += [ "//build/config/compiler:no_chromium_code" ]
- configs += [ ":internal_config", ":features", ":toolchain" ]
-
- deps = [
- ":v8_base",
- ":v8_nosnapshot",
- ]
+ sources = [
+ "src/mksnapshot.cc",
+ ]
- libs = []
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+ configs += [ ":internal_config", ":features", ":toolchain" ]
- if (v8_compress_startup_data == "bz2") {
- libs += [ "bz2" ]
- }
+ deps = [
+ ":v8_base",
+ ":v8_nosnapshot",
+ ]
- if (is_android && current_toolchain != host_toolchain) {
- libs += [ "log" ]
+ if (v8_compress_startup_data == "bz2") {
+ libs = [ "bz2" ]
+ }
}
}
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":internal_config", ":features", ":toolchain" ]
- # TODO(jochen): Support direct dependent configs.
+ direct_dependent_configs = [ ":external_config" ]
+
+ if (is_android && current_toolchain != host_toolchain) {
+ libs += [ "log" ]
+ }
}
} else {
":v8_nosnapshot",
]
}
- # TODO(jochen): Support direct dependent configs.
+
+ direct_dependent_configs = [ ":external_config" ]
}
}