Fix import/export annotations for v8 targets that are always static

Instead of suppressing the linker warnings and disallowing incremental
linking, just fix the annotations..

R=machenbach@chromium.org,jgruber@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2420603002
Cr-Commit-Position: refs/heads/master@{#40260}
This commit is contained in:
jochen 2016-10-13 05:44:15 -07:00 committed by Commit bot
parent 41f51fe3ef
commit 29ddd7ff82
7 changed files with 29 additions and 41 deletions

View File

@ -2405,6 +2405,10 @@ v8_source_set("fuzzer_support_nocomponent") {
":v8_maybe_snapshot",
]
if (is_component_build) {
defines = [ "BUILDING_V8_SHARED" ]
}
public_deps = [
":v8_libbase",
":v8_libplatform",
@ -2653,10 +2657,13 @@ v8_executable("v8_parser_shell") {
"//build/win:default_exe_manifest",
]
defines = []
if (is_component_build) {
# v8_parser_shell can't be built against a shared library, so we
# need to depend on the underlying static target in that case.
deps += [ ":v8_maybe_snapshot" ]
defines += [ "BUILDING_V8_SHARED" ]
} else {
deps += [ ":v8" ]
}
@ -2744,6 +2751,10 @@ v8_source_set("parser_fuzzer") {
":fuzzer_support_nocomponent",
]
if (is_component_build) {
defines = [ "BUILDING_V8_SHARED" ]
}
configs = [
":external_config",
":internal_config_base",

View File

@ -35,11 +35,6 @@
// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
// static library or building a program which uses the V8 static library neither
// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
build configuration to ensure that at most one of these is set
#endif
#ifdef BUILDING_V8_SHARED
# define V8_EXPORT __declspec(dllexport)
#elif USING_V8_SHARED

View File

@ -317,11 +317,6 @@ v8_executable("cctest") {
"../..:internal_config_base",
]
if (is_win) {
remove_configs = [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:no_incremental_linking" ]
}
# TODO(machenbach): Translate from gyp.
#["OS=="aix"", {
# "ldflags": [ "-Wl,-bbigtoc" ],
@ -337,10 +332,13 @@ v8_executable("cctest") {
"//build/win:default_exe_manifest",
]
defines = []
if (is_component_build) {
# cctest can't be built against a shared library, so we
# need to depend on the underlying static target in that case.
deps += [ "../..:v8_maybe_snapshot" ]
defines += [ "BUILDING_V8_SHARED" ]
} else {
deps += [ "../..:v8" ]
}
@ -364,14 +362,6 @@ v8_executable("cctest") {
# MSVS wants this for gay-{precision,shortest}.cc.
cflags += [ "/bigobj" ]
# Suppress warnings about importing locally defined symbols.
if (is_component_build) {
ldflags += [
"/ignore:4049",
"/ignore:4217",
]
}
}
}
@ -427,20 +417,13 @@ v8_executable("generate-bytecode-expectations") {
"//build/win:default_exe_manifest",
]
defines = []
if (is_component_build) {
# Same as cctest, we need to depend on the underlying static target.
deps += [ "../..:v8_maybe_snapshot" ]
defines += [ "BUILDING_V8_SHARED" ]
} else {
deps += [ "../..:v8" ]
}
if (is_win) {
# Suppress warnings about importing locally defined symbols.
if (is_component_build) {
ldflags = [
"/ignore:4049",
"/ignore:4217",
]
}
}
}

View File

@ -429,6 +429,7 @@
# cctest can't be built against a shared library, so we need to
# depend on the underlying static target in that case.
'dependencies': ['../../src/v8.gyp:v8_maybe_snapshot'],
'defines': [ 'BUILDING_V8_SHARED', ]
}, {
'dependencies': ['../../src/v8.gyp:v8'],
}],
@ -479,6 +480,7 @@
['component=="shared_library"', {
# Same as cctest, we need to depend on the underlying static target.
'dependencies': ['../../src/v8.gyp:v8_maybe_snapshot'],
'defines': [ 'BUILDING_V8_SHARED', ]
}, {
'dependencies': ['../../src/v8.gyp:v8'],
}],

View File

@ -59,6 +59,11 @@
'sources': [ ### gcmole(all) ###
'parser.cc',
],
'conditions': [
['component=="shared_library"', {
'defines': [ 'BUILDING_V8_SHARED', ]
}],
],
},
{
'target_name': 'v8_simple_regexp_fuzzer',
@ -416,6 +421,7 @@
# fuzzers can't be built against a shared library, so we need to
# depend on the underlying static target in that case.
'dependencies': ['../../src/v8.gyp:v8_maybe_snapshot'],
'defines': [ 'BUILDING_V8_SHARED', ]
}, {
'dependencies': ['../../src/v8.gyp:v8'],
}],

View File

@ -153,11 +153,6 @@ v8_executable("unittests") {
"../..:internal_config_base",
]
if (is_win) {
remove_configs = [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:no_incremental_linking" ]
}
# TODO(machenbach): Translate from gyp.
#['OS=="aix"', {
# 'ldflags': [ '-Wl,-bbigtoc' ],
@ -172,10 +167,13 @@ v8_executable("unittests") {
"//testing/gtest",
]
defines = []
if (is_component_build) {
# compiler-unittests can't be built against a shared library, so we
# need to depend on the underlying static target in that case.
deps += [ "../..:v8_maybe_snapshot" ]
defines += [ "BUILDING_V8_SHARED" ]
} else {
deps += [ "../..:v8" ]
}
@ -185,13 +183,5 @@ v8_executable("unittests") {
# bytecode-utils.h.
# C4309: 'static_cast': truncation of constant value
cflags = [ "/wd4309" ]
# Suppress warnings about importing locally defined symbols.
if (is_component_build) {
ldflags = [
"/ignore:4049",
"/ignore:4217",
]
}
}
}

View File

@ -230,6 +230,7 @@
# compiler-unittests can't be built against a shared library, so we
# need to depend on the underlying static target in that case.
'dependencies': ['../../src/v8.gyp:v8_maybe_snapshot'],
'defines': [ 'BUILDING_V8_SHARED', ]
}, {
'dependencies': ['../../src/v8.gyp:v8'],
}],