summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 18:09:13 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 18:09:13 +0000
commitd00f8dcf1ab8f6af0b1a7c2c160615962d76c122 (patch)
treef699793603c201998f97d0d45d0f0207cb12b7c4
parent0b48d60dd5fbb2175617959798d52bbb58946779 (diff)
downloadchromium_src-d00f8dcf1ab8f6af0b1a7c2c160615962d76c122.zip
chromium_src-d00f8dcf1ab8f6af0b1a7c2c160615962d76c122.tar.gz
chromium_src-d00f8dcf1ab8f6af0b1a7c2c160615962d76c122.tar.bz2
Get rid of separate SConscript.main.linux:
* Set -j default to %NUMBER_OF_PROCESSORS% + 1 only on Windows. * Initialize LOAD= modules up front, and let Linux override to the subset that are currently building. * Initialize Linux CCFLAGS, LINKFLAGS and LIBS in a separate if-clause (like we do for Windows). * Remove SCONSCRIPT_MAIN code in {base,chrome}/SConstruct in favor of just call ../build/SConscript.main. * Merge in evanm's changes to base/SConscript for separate lists of platform-neutral and platform-specific source files and test files. R=evanm,deanm git-svn-id: svn://svn.chromium.org/chrome/trunk/src@727 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/SConscript111
-rw-r--r--base/SConstruct10
-rw-r--r--build/SConscript.main29
-rw-r--r--chrome/SConstruct10
4 files changed, 94 insertions, 66 deletions
diff --git a/base/SConscript b/base/SConscript
index f4fc47a..b2d0d61 100644
--- a/base/SConscript
+++ b/base/SConscript
@@ -51,16 +51,39 @@ if env['PLATFORM'] == 'win32':
],
)
+if env['PLATFORM'] == 'posix':
+ env.Replace(
+ LIBS = ['pthread'],
+ )
+
+# These base files work on *all* platforms; files that don't work
+# cross-platform live below.
input_files = [
'at_exit.cc',
+ 'base_switches.cc',
+ 'command_line.cc',
+ 'icu_util.cc',
+ 'lock.cc',
+ 'logging.cc',
+ 'platform_thread.cc',
+ 'string_escape.cc',
+ 'string_piece.cc',
+ 'string_util.cc',
+ 'string_util_icu.cc',
+ 'values.cc',
+]
+
+if env['PLATFORM'] == 'win32':
+ # Some of these aren't really Windows-specific, they're just here until
+ # we have the port versions working.
+ # TODO(evanm): label all these modules with whether they're needing work
+ # or unfeasible.
+ input_files.extend([
'base_drag_source.cc',
'base_drop_target.cc',
'base_paths.cc',
- 'base_switches.cc',
'bzip2_error_handler.cc',
- 'clipboard.cc',
'clipboard_util.cc',
- 'command_line.cc',
'debug_on_start.cc',
'debug_util.cc',
'event_recorder.cc',
@@ -69,13 +92,10 @@ input_files = [
'histogram.cc',
'hmac.cc',
'iat_patch.cc',
- 'icu_util.cc',
'idle_timer.cc',
'image_util.cc',
'json_reader.cc',
'json_writer.cc',
- 'lock.cc',
- 'logging.cc',
'md5.cc',
'memory_debug.cc',
'message_loop.cc',
@@ -84,7 +104,6 @@ input_files = [
'path_service.cc',
'pe_image.cc',
'pickle.cc',
- 'platform_thread.cc',
'process.cc',
'process_util.cc',
'registry.cc',
@@ -94,10 +113,6 @@ input_files = [
'shared_event.cc',
'shared_memory.cc',
'stats_table.cc',
- 'string_escape.cc',
- 'string_piece.cc',
- 'string_util.cc',
- 'string_util_icu.cc',
'third_party/nspr/prtime.cc',
'third_party/nss/sha512.cc',
'thread.cc',
@@ -105,17 +120,17 @@ input_files = [
'timer.cc',
'tracked.cc',
'tracked_objects.cc',
- 'values.cc',
'watchdog.cc',
'win_util.cc',
'wmi_util.cc',
'word_iterator.cc',
'worker_pool.cc',
-]
+ ])
if env['PLATFORM'] == 'win32':
input_files.extend([
'base_paths_win.cc',
+ 'clipboard_win.cc',
'condition_variable_win.cc',
'file_util_win.cc',
'lock_impl_win.cc',
@@ -126,24 +141,31 @@ if env['PLATFORM'] == 'win32':
'waitable_event_win.cc',
])
+if env['PLATFORM'] in ('darwin', 'posix'):
+ input_files.extend([
+ 'condition_variable_posix.cc',
+ 'lock_impl_posix.cc',
+ 'thread_local_storage_posix.cc',
+ 'time_posix.cc',
+ 'waitable_event_generic.cc',
+ ])
+
if env['PLATFORM'] == 'darwin':
input_files.extend([
+ 'base_paths_mac.mm',
+ 'clipboard_mac.cc',
+ 'file_util_mac.mm',
+ 'file_version_info_mac.mm',
+ 'thread_posix.cc',
'sys_string_conversions_mac.cc',
])
if env['PLATFORM'] == 'posix':
input_files.extend([
+ 'atomicops_internals_x86_gcc.cc',
'file_util_linux.cc',
- ])
-
-if env['PLATFORM'] in ('darwin', 'posix'):
- input_files.extend([
- 'condition_variable_posix.cc',
- 'lock_impl_posix.cc',
- 'thread_posix.cc',
- 'thread_local_storage_posix.cc',
- 'time_posix.cc',
- 'waitable_event_generic.cc',
+ 'string_util_mac.cc',
+ 'sys_string_conversions_linux.cc',
])
env.ChromeStaticLibrary('base', input_files)
@@ -209,19 +231,41 @@ if env['PLATFORM'] == 'win32':
],
)
+if env['PLATFORM'] == 'posix':
+ # Remove the libraries that don't build yet under Linux.
+ env_tests['LIBS'].remove('base_gfx')
+ env_tests['LIBS'].remove('skia')
+ env_tests['LIBS'].remove('libpng')
+ env_tests['LIBS'].remove('zlib')
+
env_tests.ChromeTestProgram(['debug_message.exe',
'debug_message.ilk',
'debug_message.pdb'],
['debug_message.cc'])
+# These test files work on *all* platforms; tests that don't work
+# cross-platform live below.
test_files = [
'at_exit_unittest.cc',
+ 'linked_ptr_unittest.cc',
+ 'pickle_unittest.cc',
+ 'ref_counted_unittest.cc',
+ 'run_all_unittests.cc',
+ 'string_escape_unittest.cc',
+ 'string_piece_unittest.cc',
+ 'string_tokenizer_unittest.cc',
+ 'values_unittest.cc',
+]
+
+if env['PLATFORM'] == 'win32':
+ # These tests aren't really Windows-specific, they're just here until
+ # we have the port versions working.
+ test_files.extend([
'check_handler_unittest.cc',
'clipboard_unittest.cc',
'command_line_unittest.cc',
'condition_variable_test.cc',
'file_util_unittest.cc',
- 'file_version_info_unittest.cc',
'gfx/convolver_unittest.cc',
'gfx/image_operations_unittest.cc',
'gfx/native_theme_unittest.cc',
@@ -234,15 +278,12 @@ test_files = [
'hmac_unittest.cc',
'json_reader_unittest.cc',
'json_writer_unittest.cc',
- 'linked_ptr_unittest.cc',
'message_loop_unittest.cc',
'object_watcher_unittest.cc',
'path_service_unittest.cc',
'pe_image_unittest.cc',
- 'pickle_unittest.cc',
- 'pr_time_test.cc',
'process_util_unittest.cc',
- 'ref_counted_unittest.cc',
+ 'pr_time_test.cc',
'run_all_unittests.cc',
'sha2_unittest.cc',
'shared_event_unittest.cc',
@@ -250,25 +291,23 @@ test_files = [
'singleton_unittest.cc',
'stack_container_unittest.cc',
'stats_table_unittest.cc',
- 'string_escape_unittest.cc',
- 'string_piece_unittest.cc',
- 'string_tokenizer_unittest.cc',
'string_util_unittest.cc',
'thread_local_storage_unittest.cc',
'thread_unittest.cc',
- 'time_unittest.cc',
'timer_unittest.cc',
+ 'time_unittest.cc',
'tracked_objects_test.cc',
- 'values_unittest.cc',
'waitable_event_unittest.cc',
- 'win_util_unittest.cc',
- 'wmi_util_unittest.cc',
'word_iterator_unittest.cc',
-]
+ ])
if env['PLATFORM'] == 'win32':
+ # Windows-specific tests.
test_files.extend([
+ 'file_version_info_unittest.cc',
'sys_string_conversions_win_unittest.cc',
+ 'win_util_unittest.cc',
+ 'wmi_util_unittest.cc',
])
base_unittests = env_tests.ChromeTestProgram([
diff --git a/base/SConstruct b/base/SConstruct
index 692da7a..c64037f 100644
--- a/base/SConstruct
+++ b/base/SConstruct
@@ -28,13 +28,5 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
build_component = 'base'
-
-# TODO(keunwoo): Merge ../build/SConscript.main.linux back to SConscript.main,
-# then remove this.
-if Environment()['PLATFORM'] == 'posix':
- SCONSCRIPT_MAIN = '../build/SConscript.main.linux'
-else:
- SCONSCRIPT_MAIN = '../build/SConscript.main'
-
-SConscript(SCONSCRIPT_MAIN,
+SConscript('../build/SConscript.main',
exports=['build_component'])
diff --git a/build/SConscript.main b/build/SConscript.main
index 1c5af2e..8816938 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -31,9 +31,6 @@ import os
import shutil
import sys
-#TODO(rspangler): extra imports for testing
-#from SCons.Script.__init__ import *
-
p = ARGUMENTS.get('PROGRESS')
if p == 'spinner':
@@ -44,8 +41,12 @@ elif p == 'name':
SetOption('warn', ['no-missing-sconscript'] + GetOption('warn'))
-processors = int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
-SetOption('num_jobs', processors + 1)
+
+load = ARGUMENTS.get('LOAD')
+if load:
+ load = load.split(',')
+else:
+ load = []
env = Environment(
@@ -124,6 +125,9 @@ env.AddMethod(ChromeSharedLibrary, "ChromeSharedLibrary")
if env['PLATFORM'] == 'win32':
+ processors = int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
+ SetOption('num_jobs', processors + 1)
+
msvs_env = Environment(tools=['msvc', 'mslink', 'msvs'])['ENV']
env.Replace(
@@ -262,7 +266,14 @@ if env['PLATFORM'] == 'win32':
elif env['PLATFORM'] == 'posix':
- env.Replace()
+ # For now, linux only loads the components we know work on Linux, by default.
+ load = ['base', 'testing', 'third_party']
+
+ env.Replace(
+ # TODO(linux): we should also compile with -Werror, but not yet.
+ CCFLAGS = ['-m32', '-g'],
+ LINKFLAGS = ['-m32'],
+ )
else:
@@ -299,12 +310,6 @@ env.Decider('MD5-timestamp')
env.Dir('$TARGET_ROOT').addRepository(Dir('..'))
-load = ARGUMENTS.get('LOAD')
-if load:
- load = load.split(',')
-else:
- load = []
-
included = [c for c in load if not c.startswith('-')]
excluded = [c[1:] for c in load if c.startswith('-')]
if not included:
diff --git a/chrome/SConstruct b/chrome/SConstruct
index 60245b9..04808bc 100644
--- a/chrome/SConstruct
+++ b/chrome/SConstruct
@@ -28,13 +28,5 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
build_component = 'chrome'
-
-# TODO(keunwoo): Merge ../build/SConscript.main.linux back to SConscript.main,
-# then remove this.
-if Environment()['PLATFORM'] == 'posix':
- SCONSCRIPT_MAIN = '../build/SConscript.main.linux'
-else:
- SCONSCRIPT_MAIN = '../build/SConscript.main'
-
-SConscript(SCONSCRIPT_MAIN,
+SConscript('../build/SConscript.main',
exports=['build_component'])