summaryrefslogtreecommitdiffstats
path: root/gears
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 22:58:52 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 22:58:52 +0000
commitefb07436b9ba4737247cdf0e8ba0529e27942468 (patch)
tree8a96f13f3af49c7c15efe3e3db3e1727100f52de /gears
parent39354f413433746b7f35135f85c1940210324eff (diff)
downloadchromium_src-efb07436b9ba4737247cdf0e8ba0529e27942468.zip
chromium_src-efb07436b9ba4737247cdf0e8ba0529e27942468.tar.gz
chromium_src-efb07436b9ba4737247cdf0e8ba0529e27942468.tar.bz2
Changes to make it possible to statically link Gears. This is disabled by an
#ifdef. This only partially works. Missing pieces: - gears resources for HTML dialogs (permissions, shortcut, settings). - able to compile with a non-official gears build. Review URL: http://codereview.chromium.org/18299 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8238 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears')
-rw-r--r--gears/SConscript25
-rw-r--r--gears/SConscript.browser19
2 files changed, 33 insertions, 11 deletions
diff --git a/gears/SConscript b/gears/SConscript
index 345c5c1..3d16d3e 100644
--- a/gears/SConscript
+++ b/gears/SConscript
@@ -74,7 +74,9 @@ vars.AddVariables(
EnumVariable('MODE',
'Type of binary to generate', 'dbg', ['dbg', 'opt']),
BoolVariable('OFFICIAL_BUILD',
- 'Create a binary suitable for public release', 0)
+ 'Create a binary suitable for public release', 0),
+ BoolVariable('GEARS_STATIC_LIB',
+ 'Create a static library for linking with Chrome', 0),
)
vars.Update(env)
@@ -349,15 +351,24 @@ if env['OFFICIAL_BUILD']:
CPPDEFINES = 'OFFICIAL_BUILD=1',
M4FLAGS = '-DOFFICIAL_BUILD=1',
)
+if env['GEARS_STATIC_LIB']:
+ env.Append(
+ CPPDEFINES = 'GEARS_STATIC_LIB=1',
+ )
# TODO: if USING_LIBPNG
env.Append(
CPPDEFINES = [
'PNG_USER_CONFIG',
'CHROME_PNG_WRITE_SUPPORT',
- 'GEARS_PNG_BUILD',
]
)
+if not env['GEARS_STATIC_LIB']:
+ # If we're not linking with Chrome, don't prefix all the symbols with
+ # webkit_.
+ env.Append(CPPDEFINES = ['GEARS_PNG_BUILD'])
+
+
# TODO: if USING_ZLIB
env.Append(
CPPDEFINES = [
@@ -468,7 +479,6 @@ if env['OS'] in ['win32', 'wince']:
],
CPPFLAGS = [
'/nologo',
- '/Zc:wchar_t-',
'/c',
'/W3',
'/WX',
@@ -600,6 +610,15 @@ if env['OS'] in ['win32', 'wince']:
'/OPT:ICF',
],
)
+ if not env['GEARS_STATIC_LIB']:
+ # Build with 2-byte wchar_t's only if we're building a DLL. To link with
+ # Chrome, we need 4-byte wchar_t.
+ env.Append(
+ CPPFLAGS = [
+ '/Zc:wchar_t-',
+ ],
+ )
+
#--------------------------- LINUX ---------------------------
elif env['OS'] == 'linux':
env.Append(
diff --git a/gears/SConscript.browser b/gears/SConscript.browser
index ffb0c30..c6b4d48 100644
--- a/gears/SConscript.browser
+++ b/gears/SConscript.browser
@@ -503,14 +503,17 @@ outputs['MODULE'] = env.InstallAs('${SHLIBPREFIX}gears${SHLIBSUFFIX}', module)
if env['OS'] in ['win32', 'wince'] and env['MODE'] == 'dbg':
outputs['MODULE_PDB'] = env.InstallAs('gears.pdb',
'gears-$OS-$ARCH-$MODE-${BROWSER}.pdb')
- env.Alias('gears', outputs['MODULE_PDB'])
-env.Alias('gears', outputs['MODULE'])
-
-if env['OS'] == 'win32' and env['BROWSER'] == 'NPAPI':
- lib = env.ChromeLibrary('gears-static',
- env.SharedObject(GetInputs('$BROWSER_CPPSRCS')) +
- GetInputs('$BROWSER_LINKSRCS'))
- env.Alias('gears-static', lib)
+
+if env['GEARS_STATIC_LIB']:
+ if env['OS'] == 'win32' and env['BROWSER'] == 'NPAPI':
+ lib = env.ChromeLibrary('gears-static',
+ env.SharedObject(GetInputs('$BROWSER_CPPSRCS')) +
+ GetInputs('$BROWSER_LINKSRCS'))
+ env.Alias('gears', lib)
+else:
+ env.Alias('gears', outputs['MODULE'])
+ if 'MODULE_PDB' in outputs:
+ env.Alias('gears', outputs['MODULE_PDB'])
if env['OS'] == 'wince':
env.Append(WINCE_SETUP_LINKSRCS = [