summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-13 07:12:35 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-13 07:12:35 +0000
commitb2ff764f2e40a49c8422b8119117bb610da5ac77 (patch)
tree0ed470d61100c919cea1782d42298654c3166d2e /base
parent6f4c7e1d09609b8276aa2848ca9e513d513d6bf3 (diff)
downloadchromium_src-b2ff764f2e40a49c8422b8119117bb610da5ac77.zip
chromium_src-b2ff764f2e40a49c8422b8119117bb610da5ac77.tar.gz
chromium_src-b2ff764f2e40a49c8422b8119117bb610da5ac77.tar.bz2
Add COMPONENT_BUILD global define.
This avoids the need to define FOO_DLL macros for each project that we wish to optionally build as a DLL (when component=="shared_library"). This in turn means that we do not need direct_dependent_settings to define FOO_DLL, and that means that we don't need to update projects to convert transitive dependencies into explicit dependencies. This makes the component build more consistent with the static build. An alternative would be to use all_dependent_settings, but I feel that the global approach is simpler as it creates less repetition in each target definition for components. A side-effect of this change is that I needed to make base_nacl_win64 be a shared_library in the component build. R=rvargas,bradnelson Review URL: http://codereview.chromium.org/7344022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/at_exit.cc2
-rw-r--r--base/base.gypi49
-rw-r--r--base/base_api.h4
-rw-r--r--base/debug/debug_on_start_win.h4
-rw-r--r--base/logging.h2
5 files changed, 42 insertions, 19 deletions
diff --git a/base/at_exit.cc b/base/at_exit.cc
index cafe75b..c7daad4 100644
--- a/base/at_exit.cc
+++ b/base/at_exit.cc
@@ -22,7 +22,7 @@ static AtExitManager* g_top_manager = NULL;
AtExitManager::AtExitManager() : next_manager_(g_top_manager) {
// If multiple modules instantiate AtExitManagers they'll end up living in this
// module... they have to coexist.
-#if !defined(BASE_DLL)
+#if !defined(COMPONENT_BUILD)
DCHECK(!g_top_manager);
#endif
g_top_manager = this;
diff --git a/base/base.gypi b/base/base.gypi
index 79bff9b..ea23a8e 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -535,25 +535,13 @@
},],
[ 'component=="shared_library"', {
'defines': [
- 'BASE_DLL',
'BASE_IMPLEMENTATION',
],
'conditions': [
['OS=="win"', {
- 'msvs_disabled_warnings': [
- 4251,
- ],
'sources!': [
'debug/debug_on_start_win.cc',
],
- 'direct_dependent_settings': {
- 'defines': [
- 'BASE_DLL',
- ],
- 'msvs_disabled_warnings': [
- 4251,
- ],
- },
}],
],
}],
@@ -605,7 +593,7 @@
'targets': [
{
'target_name': 'base_nacl_win64',
- 'type': 'static_library',
+ 'type': '<(component)',
'variables': {
'base_target': 1,
},
@@ -631,6 +619,41 @@
'msvs_target_platform': 'x64',
},
},
+ 'conditions': [
+ [ 'component == "shared_library"', {
+ 'defines': [
+ 'BASE_IMPLEMENTATION',
+ ],
+ 'sources!': [
+ 'debug/debug_on_start_win.cc',
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'base_i18n_nacl_win64',
+ 'type': 'static_library',
+ # TODO(gregoryd): direct_dependent_settings should be shared with the
+ # 32-bit target, but it doesn't work due to a bug in gyp
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '..',
+ ],
+ },
+ 'defines': [
+ '<@(nacl_win64_defines)',
+ ],
+ 'include_dirs': [
+ '..',
+ ],
+ 'sources': [
+ 'i18n/icu_util_nacl_win64.cc',
+ ],
+ 'configurations': {
+ 'Common_Base': {
+ 'msvs_target_platform': 'x64',
+ },
+ },
},
],
}],
diff --git a/base/base_api.h b/base/base_api.h
index 2361659..deeae07 100644
--- a/base/base_api.h
+++ b/base/base_api.h
@@ -6,7 +6,7 @@
#define BASE_BASE_API_H_
#pragma once
-#if defined(BASE_DLL)
+#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(BASE_IMPLEMENTATION)
@@ -19,7 +19,7 @@
#define BASE_API __attribute__((visibility("default")))
#endif
-#else // defined(BASE_DLL)
+#else // defined(COMPONENT_BUILD)
#define BASE_API
#endif
diff --git a/base/debug/debug_on_start_win.h b/base/debug/debug_on_start_win.h
index 4a5c120..86d4721 100644
--- a/base/debug/debug_on_start_win.h
+++ b/base/debug/debug_on_start_win.h
@@ -27,7 +27,7 @@ namespace debug {
// There is no way for this code, as currently implemented, to work across DLLs.
// TODO(rvargas): It looks like we really don't use this code, at least not for
// Chrome. Figure out if it's really worth implementing something simpler.
-#if !defined(BASE_DLL)
+#if !defined(COMPONENT_BUILD)
// Debug on start functions and data.
class DebugOnStart {
@@ -74,7 +74,7 @@ DECLSPEC_SELECTANY DebugOnStart::PIFV debug_on_start = &DebugOnStart::Init;
#endif // _WIN64
-#endif // defined(BASE_DLL)
+#endif // defined(COMPONENT_BUILD)
} // namespace debug
} // namespace base
diff --git a/base/logging.h b/base/logging.h
index 849de0e..d098937 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -469,7 +469,7 @@ std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
}
// MSVC doesn't like complex extern templates and DLLs.
-#if !defined(COMPILER_MSVC) && defined(BASE_DLL)
+#if !defined(COMPILER_MSVC) && defined(COMPONENT_BUILD)
// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
// in logging.cc.
extern template std::string* MakeCheckOpString<int, int>(