summaryrefslogtreecommitdiffstats
path: root/gears/SConscript.common
diff options
context:
space:
mode:
Diffstat (limited to 'gears/SConscript.common')
-rw-r--r--gears/SConscript.common90
1 files changed, 46 insertions, 44 deletions
diff --git a/gears/SConscript.common b/gears/SConscript.common
index 0e1aa43..c949d18 100644
--- a/gears/SConscript.common
+++ b/gears/SConscript.common
@@ -35,31 +35,26 @@ env.Prepend(
]
)
-m4srcs = []
-binsrcs = []
-crash_sender_srcs = []
-ipc_test_srcs = []
-
#-----------------------------------------------------------------------------
# crash_sender
if env['OS'] == 'win32':
- crash_sender_srcs += [
+ env.Append(CRASH_SENDER_CPPSRCS = [
'$OPEN_DIR/crash_sender/crash_sender_win32.cc',
'$THIRD_PARTY_DIR/breakpad/src/client/windows/sender/crash_report_sender.cc',
'$THIRD_PARTY_DIR/breakpad/src/common/windows/http_upload.cc',
- ]
+ ])
elif env['OS'] == 'osx':
print 'TODO: crash_sender'
#-----------------------------------------------------------------------------
# ipc_test
-m4srcs += [
+env.Append(COMMON_M4SRCS = [
'$OPEN_DIR/base/common/product_constants.h.m4',
-]
+])
-ipc_test_srcs += [
+env.Append(IPC_TEST_CPPSRCS = [
'$OPEN_DIR/base/common/event.cc',
'$OPEN_DIR/base/common/ipc_message_queue_linux.cc',
'$OPEN_DIR/base/common/ipc_message_queue_null.cc',
@@ -81,51 +76,51 @@ ipc_test_srcs += [
'$OPEN_DIR/base/common/thread_posix.cc',
'$OPEN_DIR/base/common/thread_win32.cc',
'$OPEN_DIR/base/common/time_utils_win32.cc',
-]
+])
if env['OS'] == 'osx':
- ipc_test_srcs += [
+ env.Append(IPC_TEST_CPPSRCS = [
'$OPEN_DIR/base/common/common_osx.mm',
'$OPEN_DIR/base/common/ipc_message_queue_test_osx.mm',
- ]
+ ])
-ipc_test_srcs += [
+env.Append(IPC_TEST_CPPSRCS = [
'$THIRD_PARTY_DIR/convert_utf/ConvertUTF.c'
-]
+])
#-----------------------------------------------------------------------------
# inspector
if not env['OFFICIAL_BUILD']:
- binsrcs += [
- '$OPEN_DIR/inspector/console.html',
- '$OPEN_DIR/inspector/database.html',
- '$OPEN_DIR/inspector/index.html',
- '$OPEN_DIR/inspector/localserver.html',
- '$OPEN_DIR/inspector/common/alert-35.png',
- '$OPEN_DIR/inspector/common/database.gif',
- '$OPEN_DIR/inspector/common/error-35.png',
- '$OPEN_DIR/inspector/common/ie6hacks.css',
- '$OPEN_DIR/inspector/common/inspector_links.js',
- '$OPEN_DIR/inspector/common/lightbulb-35.png',
- '$OPEN_DIR/inspector/common/localserver.gif',
- '$OPEN_DIR/inspector/common/question-35.png',
- '$OPEN_DIR/inspector/common/styles.css',
- '$OPEN_DIR/inspector/common/workerpool.gif',
- '$OPEN_DIR/sdk/gears_init.js',
- '$OPEN_DIR/ui/common/base.js',
- '$OPEN_DIR/ui/common/dom.js',
- '$OPEN_DIR/ui/common/icon_32x32.png',
- ]
+ env.Append(COMMON_BINSRCS = [
+ '$OPEN_DIR/inspector/console.html',
+ '$OPEN_DIR/inspector/database.html',
+ '$OPEN_DIR/inspector/index.html',
+ '$OPEN_DIR/inspector/localserver.html',
+ '$OPEN_DIR/inspector/common/alert-35.png',
+ '$OPEN_DIR/inspector/common/database.gif',
+ '$OPEN_DIR/inspector/common/error-35.png',
+ '$OPEN_DIR/inspector/common/ie6hacks.css',
+ '$OPEN_DIR/inspector/common/inspector_links.js',
+ '$OPEN_DIR/inspector/common/lightbulb-35.png',
+ '$OPEN_DIR/inspector/common/localserver.gif',
+ '$OPEN_DIR/inspector/common/question-35.png',
+ '$OPEN_DIR/inspector/common/styles.css',
+ '$OPEN_DIR/inspector/common/workerpool.gif',
+ '$OPEN_DIR/sdk/gears_init.js',
+ '$OPEN_DIR/ui/common/base.js',
+ '$OPEN_DIR/ui/common/dom.js',
+ '$OPEN_DIR/ui/common/icon_32x32.png',
+ ])
#-----------------------------------------------------------------------------
# installer
-m4srcs += [
+env.Append(COMMON_M4SRCS = [
'$OPEN_DIR/installer/npapi_msi.wxs.m4',
'$OPEN_DIR/installer/win32_msi.wxs.m4',
'$OPEN_DIR/installer/wince_cab.inf.m4',
-]
+])
#-----------------------------------------------------------------------------
# Generate the dependency tree.
@@ -134,26 +129,33 @@ common_targets = {}
def PatternRule(t, s): return utils.PatternRule(t, s, env)
+def GetInputs(var):
+ """Expands an env substitution variable and returns it as a list of
+ strings."""
+ return [str(v) for v in env.subst_list(var)[0]]
+
# genfiles/%: %.m4
common_targets['m4'] = \
[env.M4(*PatternRule('$COMMON_GENFILES_DIR/${SOURCE.filebase}', src))
- for src in m4srcs]
+ for src in GetInputs('$COMMON_M4SRCS')]
# genfiles/%.from_bin.cc: %
-bins = [env.Bin2cpp(*PatternRule(
- '$COMMON_GENFILES_DIR/${SOURCE.file}.from_bin.cc', src))
- for src in binsrcs]
-common_targets['src'] = [env.SharedObject(bin) for bin in bins]
+if GetInputs('$COMMON_BINSRCS'):
+ bins = [env.Bin2cpp(*PatternRule(
+ '$COMMON_GENFILES_DIR/${SOURCE.file}.from_bin.cc', src))
+ for src in GetInputs('$COMMON_BINSRCS')]
+ common_targets['src'] = [env.SharedObject(bin) for bin in bins]
Export('common_targets')
-env.ChromeProgram('ipc_test', ipc_test_srcs)
+env.ChromeProgram('ipc_test', GetInputs('$IPC_TEST_CPPSRCS'))
# Note: crash_sender.exe name needs to stay in sync with name used in
# exception_handler_win32.cc and exception_handler_osx/google_breakpad.mm.
crash_sender = None
if env['OS'] == 'win32':
- crash_sender = env.ChromeProgram('crash_sender', crash_sender_srcs,
+ crash_sender = env.ChromeProgram('crash_sender',
+ GetInputs('$CRASH_SENDER_CPPSRCS'),
LIBS = Split('advapi32.lib shell32.lib wininet.lib'))
elif env['OS'] == 'osx':
pass