diff options
author | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 21:40:28 +0000 |
---|---|---|
committer | dpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-10 21:40:28 +0000 |
commit | d452696d51c8737c0f2c4eada4369aa9530e57bd (patch) | |
tree | d983a1a224845a26f0e6173c8b7e4bc658a29539 | |
parent | 5b4fc5b7c88b94d0e8b61eddd1c9203723ebd29e (diff) | |
download | chromium_src-d452696d51c8737c0f2c4eada4369aa9530e57bd.zip chromium_src-d452696d51c8737c0f2c4eada4369aa9530e57bd.tar.gz chromium_src-d452696d51c8737c0f2c4eada4369aa9530e57bd.tar.bz2 |
build sql as a component - this will help ensure there is only one copy
of sqlite getting linked in.
R=rsesek@chromium.org
Review URL: http://codereview.chromium.org/8506027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109510 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | sql/connection.h | 5 | ||||
-rw-r--r-- | sql/diagnostic_error_delegate.h | 1 | ||||
-rw-r--r-- | sql/meta_table.h | 3 | ||||
-rw-r--r-- | sql/sql.gyp | 3 | ||||
-rw-r--r-- | sql/sql_export.h | 26 | ||||
-rw-r--r-- | sql/statement.h | 3 | ||||
-rw-r--r-- | sql/transaction.h | 3 |
7 files changed, 38 insertions, 6 deletions
diff --git a/sql/connection.h b/sql/connection.h index 5807e36..5446c0c 100644 --- a/sql/connection.h +++ b/sql/connection.h @@ -13,6 +13,7 @@ #include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/time.h" +#include "sql/sql_export.h" class FilePath; struct sqlite3; @@ -76,7 +77,7 @@ class Connection; // the OnError() callback. // The tipical usage is to centralize the code designed to handle database // corruption, low-level IO errors or locking violations. -class ErrorDelegate : public base::RefCounted<ErrorDelegate> { +class SQL_EXPORT ErrorDelegate : public base::RefCounted<ErrorDelegate> { public: ErrorDelegate(); @@ -99,7 +100,7 @@ class ErrorDelegate : public base::RefCounted<ErrorDelegate> { virtual ~ErrorDelegate(); }; -class Connection { +class SQL_EXPORT Connection { private: class StatementRef; // Forward declaration, see real one below. diff --git a/sql/diagnostic_error_delegate.h b/sql/diagnostic_error_delegate.h index 70677bd..6a09fc0 100644 --- a/sql/diagnostic_error_delegate.h +++ b/sql/diagnostic_error_delegate.h @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/metrics/histogram.h" #include "sql/connection.h" +#include "sql/sql_export.h" namespace sql { diff --git a/sql/meta_table.h b/sql/meta_table.h index 4a640d8..8d98f0f 100644 --- a/sql/meta_table.h +++ b/sql/meta_table.h @@ -9,13 +9,14 @@ #include <string> #include "base/basictypes.h" +#include "sql/sql_export.h" namespace sql { class Connection; class Statement; -class MetaTable { +class SQL_EXPORT MetaTable { public: MetaTable(); ~MetaTable(); diff --git a/sql/sql.gyp b/sql/sql.gyp index ac87444..f16f91a 100644 --- a/sql/sql.gyp +++ b/sql/sql.gyp @@ -9,11 +9,12 @@ 'targets': [ { 'target_name': 'sql', - 'type': 'static_library', + 'type': '<(component)', 'dependencies': [ '../base/base.gyp:base', '../third_party/sqlite/sqlite.gyp:sqlite', ], + 'defines': [ 'SQL_IMPLEMENTATION' ], 'sources': [ 'connection.cc', 'connection.h', diff --git a/sql/sql_export.h b/sql/sql_export.h new file mode 100644 index 0000000..92a01cb --- /dev/null +++ b/sql/sql_export.h @@ -0,0 +1,26 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SQL_EXPORT_H_ +#define SQL_EXPORT_H_ +#pragma once + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(SQL_IMPLEMENTATION) +#define SQL_EXPORT __declspec(dllexport) +#else +#define SQL_EXPORT __declspec(dllimport) +#endif // defined(SQL_IMPLEMENTATION) + +#else // defined(WIN32) +#define SQL_EXPORT __attribute__((visibility("default"))) +#endif + +#else // defined(COMPONENT_BUILD) +#define SQL_EXPORT +#endif + +#endif // SQL_EXPORT_H_ diff --git a/sql/statement.h b/sql/statement.h index dbb96713..4a73578 100644 --- a/sql/statement.h +++ b/sql/statement.h @@ -13,6 +13,7 @@ #include "base/memory/ref_counted.h" #include "base/string16.h" #include "sql/connection.h" +#include "sql/sql_export.h" namespace sql { @@ -38,7 +39,7 @@ enum ColType { // Step() and Run() just return true to signal success. If you want to handle // specific errors such as database corruption, install an error handler in // in the connection object using set_error_delegate(). -class Statement { +class SQL_EXPORT Statement { public: // Creates an uninitialized statement. The statement will be invalid until // you initialize it via Assign. diff --git a/sql/transaction.h b/sql/transaction.h index 5e1a418..210cb7f 100644 --- a/sql/transaction.h +++ b/sql/transaction.h @@ -7,12 +7,13 @@ #pragma once #include "base/basictypes.h" +#include "sql/sql_export.h" namespace sql { class Connection; -class Transaction { +class SQL_EXPORT Transaction { public: // Creates the scoped transaction object. You MUST call Begin() to begin the // transaction. If you have begun a transaction and not committed it, the |