summaryrefslogtreecommitdiffstats
path: root/sandbox/src
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 16:11:15 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 16:11:15 +0000
commit93723b5339a6f238745c7445665276aa1e1f8bda (patch)
treed3b78e2041cab3cfe36582409d9a301410b20565 /sandbox/src
parent6d68331166aa8e283c254cd6d83057541b74e9fc (diff)
downloadchromium_src-93723b5339a6f238745c7445665276aa1e1f8bda.zip
chromium_src-93723b5339a6f238745c7445665276aa1e1f8bda.tar.gz
chromium_src-93723b5339a6f238745c7445665276aa1e1f8bda.tar.bz2
Fix SCons build of the sandbox module, splitting out the individual
targets into the new *.scons file naming scheme. Review URL: http://codereview.chromium.org/8616 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src')
-rw-r--r--sandbox/src/SConscript259
-rw-r--r--sandbox/src/sandbox_lib.scons100
2 files changed, 100 insertions, 259 deletions
diff --git a/sandbox/src/SConscript b/sandbox/src/SConscript
deleted file mode 100644
index 8914ba2..0000000
--- a/sandbox/src/SConscript
+++ /dev/null
@@ -1,259 +0,0 @@
-# Copyright (c) 2006-2008 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.
-
-Import('env')
-
-env = env.Clone()
-
-# Some of the sandbox sources include "gtest.h", so we need it
-# in the base env here, not just in env_tests.
-env.Prepend(
- CPPPATH = [
- '$GTEST_DIR/include',
- '$GTEST_DIR',
- '../..',
- ],
- CPPDEFINES = [
- 'CHROMIUM_BUILD',
- '_SECURE_ATL',
- ],
-)
-
-env.Append(
- CCFLAGS = [
- '/TP',
- '/WX', # treat warnings as errors
- ],
-)
-
-env_tests = env.Clone(
- TESTS_DIR = '../tests',
- INTEGRATION_TESTS_DIR = '$TESTS_DIR/integration_tests',
- UNIT_TESTS_DIR = '$TESTS_DIR/unit_tests',
- VALIDATION_TESTS_DIR = '$TESTS_DIR/validation_tests',
-)
-
-
-input_files = [
- 'Wow64.cc',
- 'acl.cc',
- 'broker_services.cc',
- 'crosscall_server.cc',
- 'dep.cc',
- 'eat_resolver.cc',
- 'filesystem_dispatcher.cc',
- 'filesystem_interception.cc',
- 'filesystem_policy.cc',
- 'interception.cc',
- 'interception_agent.cc',
- 'job.cc',
- 'named_pipe_dispatcher.cc',
- 'named_pipe_interception.cc',
- 'named_pipe_policy.cc',
- 'pe_image.cc',
- 'policy_broker.cc',
- 'policy_engine_opcodes.cc',
- 'policy_engine_processor.cc',
- 'policy_low_level.cc',
- 'policy_target.cc',
- 'process_thread_dispatcher.cc',
- 'process_thread_interception.cc',
- 'process_thread_policy.cc',
- 'registry_dispatcher.cc',
- 'registry_interception.cc',
- 'registry_policy.cc',
- 'resolver.cc',
- 'restricted_token.cc',
- 'restricted_token_utils.cc',
- 'sandbox.cc',
- 'sandbox_nt_util.cc',
- 'sandbox_policy_base.cc',
- 'sandbox_utils.cc',
- 'service_resolver.cc',
- 'shared_handles.cc',
- 'sharedmem_ipc_client.cc',
- 'sharedmem_ipc_server.cc',
- 'sid.cc',
- 'sidestep/ia32_modrm_map.cpp',
- 'sidestep/ia32_opcode_map.cpp',
- 'sidestep/mini_disassembler.cpp',
- 'sidestep/preamble_patcher_with_stub.cpp',
- 'sidestep_resolver.cc',
- 'sync_dispatcher.cc',
- 'sync_interception.cc',
- 'sync_policy.cc',
- 'target_interceptions.cc',
- 'target_process.cc',
- 'target_services.cc',
- 'win2k_threadpool.cc',
- 'win_utils.cc',
-]
-
-# TODO(bradnelson): This step generates sandbox.pch.ib_tag
-# SCons doesn't know.
-env_p = env.Clone()
-env_p.Append(CCFLAGS='/Ylsandbox')
-pch, obj = env_p.PCH(['sandbox.pch', 'stdafx.obj'], 'stdafx.cc')
-env['PCH'] = pch
-env['PCHSTOP'] = 'stdafx.h'
-env.Append(CCPCHFLAGS = ['/FIstdafx.h'])
-
-
-env.ChromeStaticLibrary('sandbox', input_files + [obj])
-
-
-env_tests.Prepend(
- LINKFLAGS = [
- '/DELAYLOAD:dwmapi.dll',
- '/DELAYLOAD:uxtheme.dll',
- '/MACHINE:X86',
- '/FIXED:No',
- '/safeseh',
- '/dynamicbase',
- '/ignore:4199',
- '/nxcompat',
- ],
- LIBS = [
- 'base',
- 'gtest',
- 'sandbox',
- ],
- LIBPATH = [
- '.',
- '$BASE_DIR'
- ],
-)
-
-controller_obj = env_tests.StaticObject('$TESTS_DIR/common/controller.cc')
-
-
-# Unit Tests
-
-env_unit_tests = env_tests.Clone()
-
-unit_test_files = [
- 'interception_unittest.cc',
- 'ipc_unittest.cc',
- 'job_unittest.cc',
- 'pe_image_unittest.cc',
- 'policy_engine_unittest.cc',
- 'policy_low_level_unittest.cc',
- 'policy_opcodes_unittest.cc',
- 'restricted_token_unittest.cc',
- 'service_resolver_unittest.cc',
- 'sid_unittest.cc',
- 'threadpool_unittest.cc',
-
- '$UNIT_TESTS_DIR/unit_tests$OBJSUFFIX',
- # The VisualStudio build link with the old gtest.obj file directly,
- # although we no longer remember why. Since we're linking with all
- # of gtest.lib now, this shouldn't be necessary (hey, the unit tests
- # all pass!), but we're leaving this here, commented out, just in case.
- #'$GTEST_DIR/src/gtest$OBJSUFFIX',
- controller_obj,
-]
-
-
-# TODO(bradnelson): This step generates unittests_tests.pch.ib_tag
-# SCons doesn't know.
-env_p = env_unit_tests.Clone()
-pch, obj = env_p.PCH(['$UNIT_TESTS_DIR/unit_tests.pch',
- '$UNIT_TESTS_DIR/unit_tests.obj'],
- '$UNIT_TESTS_DIR/unit_tests.cc')
-env_unit_tests['PCH'] = pch
-env_unit_tests['PCHSTOP'] = 'stdafx.h'
-env_unit_tests.Append(CCPCHFLAGS = ['/FIstdafx.h'])
-
-
-unit_tests = env_unit_tests.ChromeTestProgram(
- 'sbox_unittests',
- unit_test_files,
-)
-
-# Integration Tests
-
-env_integration_tests = env_tests.Clone()
-
-integration_test_files = [
- '$INTEGRATION_TESTS_DIR/integration_tests_test.cc',
-# 'dep_test.cc',
- 'file_policy_test.cc',
- 'integrity_level_test.cc',
- 'ipc_ping_test.cc',
- 'named_pipe_policy_test.cc',
- 'policy_target_test.cc',
- 'process_policy_test.cc',
- 'registry_policy_test.cc',
- 'sync_policy_test.cc',
- 'unload_dll_test.cc',
-
- '$INTEGRATION_TESTS_DIR/integration_tests$OBJSUFFIX',
- # The VisualStudio build link with the old gtest.obj file directly,
- # although we no longer remember why. Since we're linking with all
- # of gtest.lib now, this shouldn't be necessary (hey, the unit tests
- # all pass!), but we're leaving this here, commented out, just in case.
- #'$GTEST_DIR/src/gtest$OBJSUFFIX',
- controller_obj,
-]
-
-
-# TODO(bradnelson): This step generates integration_tests.pch.ib_tag
-# SCons doesn't know.
-env_p = env_integration_tests.Clone()
-pch, obj = env_p.PCH(['$INTEGRATION_TESTS_DIR/integration_tests.pch',
- '$INTEGRATION_TESTS_DIR/integration_tests.obj'],
- '$INTEGRATION_TESTS_DIR/integration_tests.cc')
-env_integration_tests['PCH'] = pch
-env_integration_tests['PCHSTOP'] = 'stdafx.h'
-env_integration_tests.Append(CCPCHFLAGS = ['/FIstdafx.h'])
-
-integration_tests = env_integration_tests.ChromeTestProgram(
- 'sbox_integration_tests',
- integration_test_files,
-)
-
-
-# Validation Tests #
-
-env_validation_tests = env_tests.Clone()
-
-env_validation_tests.Prepend(LIBS=['shlwapi.lib'])
-
-validation_test_files = [
- '$VALIDATION_TESTS_DIR/suite.cc',
- '$VALIDATION_TESTS_DIR/commands.cc',
- '$VALIDATION_TESTS_DIR/unit_tests$OBJSUFFIX',
- # The VisualStudio build link with the old gtest.obj file directly,
- # although we no longer remember why. Since we're linking with all
- # of gtest.lib now, this shouldn't be necessary (hey, the unit tests
- # all pass!), but we're leaving this here, commented out, just in case.
- #'$GTEST_DIR/src/gtest$OBJSUFFIX',
- controller_obj,
-]
-
-env_p = env_validation_tests.Clone()
-
-# TODO(bradnelson): This step generates unittests_tests.pch.ib_tag
-# SCons doesn't know.
-pch, obj = env_p.PCH(['$VALIDATION_TESTS_DIR/unit_tests.pch',
- '$VALIDATION_TESTS_DIR/unit_tests.obj'],
- '$VALIDATION_TESTS_DIR/unit_tests.cc')
-env_validation_tests['PCH'] = pch
-env_validation_tests['PCHSTOP'] = 'stdafx.h'
-env_validation_tests.Append(CCPCHFLAGS = ['/FIstdafx.h'])
-
-validation_tests = env_validation_tests.ChromeTestProgram(
- 'sbox_validation_tests',
- validation_test_files,
-)
-
-
-# Install tests to a path where they can find their inputs.
-installed_tests = env.Install('$OBJ_ROOT',
- unit_tests + validation_tests + integration_tests)
-
-
-# Setup alias for sandbox related targets.
-env.Alias('sandbox', ['.', installed_tests])
-
diff --git a/sandbox/src/sandbox_lib.scons b/sandbox/src/sandbox_lib.scons
new file mode 100644
index 0000000..4232ff8
--- /dev/null
+++ b/sandbox/src/sandbox_lib.scons
@@ -0,0 +1,100 @@
+# Copyright (c) 2006-2008 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.
+
+Import('env')
+
+env = env.Clone()
+
+env.SConscript([
+ '$GTEST_DIR/../using_gtest.scons',
+], {'env':env})
+
+# Some of the sandbox sources include "gtest.h", so we need it
+# in the base env here, not just in env_tests.
+env.Prepend(
+ CPPPATH = [
+ '$CHROME_SRC_DIR',
+ ],
+ CPPDEFINES = [
+ 'CHROMIUM_BUILD',
+ ],
+)
+
+if env['PLATFORM'] == 'win32':
+ env.Append(
+ CPPDEFINES = [
+ '_SECURE_ATL',
+ '_WINDOWS',
+ ],
+ CCFLAGS = [
+ '/TP',
+ '/WX', # treat warnings as errors
+ ],
+ )
+
+input_files = [
+ 'Wow64.cc',
+ 'acl.cc',
+ 'broker_services.cc',
+ 'crosscall_server.cc',
+ 'dep.cc',
+ 'eat_resolver.cc',
+ 'filesystem_dispatcher.cc',
+ 'filesystem_interception.cc',
+ 'filesystem_policy.cc',
+ 'interception.cc',
+ 'interception_agent.cc',
+ 'job.cc',
+ 'named_pipe_dispatcher.cc',
+ 'named_pipe_interception.cc',
+ 'named_pipe_policy.cc',
+ 'pe_image.cc',
+ 'policy_broker.cc',
+ 'policy_engine_opcodes.cc',
+ 'policy_engine_processor.cc',
+ 'policy_low_level.cc',
+ 'policy_target.cc',
+ 'process_thread_dispatcher.cc',
+ 'process_thread_interception.cc',
+ 'process_thread_policy.cc',
+ 'registry_dispatcher.cc',
+ 'registry_interception.cc',
+ 'registry_policy.cc',
+ 'resolver.cc',
+ 'restricted_token.cc',
+ 'restricted_token_utils.cc',
+ 'sandbox.cc',
+ 'sandbox_nt_util.cc',
+ 'sandbox_policy_base.cc',
+ 'sandbox_utils.cc',
+ 'service_resolver.cc',
+ 'shared_handles.cc',
+ 'sharedmem_ipc_client.cc',
+ 'sharedmem_ipc_server.cc',
+ 'sid.cc',
+ 'sidestep/ia32_modrm_map.cpp',
+ 'sidestep/ia32_opcode_map.cpp',
+ 'sidestep/mini_disassembler.cpp',
+ 'sidestep/preamble_patcher_with_stub.cpp',
+ 'sidestep_resolver.cc',
+ 'sync_dispatcher.cc',
+ 'sync_interception.cc',
+ 'sync_policy.cc',
+ 'target_interceptions.cc',
+ 'target_process.cc',
+ 'target_services.cc',
+ 'win2k_threadpool.cc',
+ 'win_utils.cc',
+]
+
+# TODO(bradnelson): This step generates sandbox.pch.ib_tag
+# SCons doesn't know.
+env_p = env.Clone()
+env_p.Append(CCFLAGS='/Ylsandbox')
+pch, obj = env_p.PCH(['sandbox.pch', 'stdafx.obj'], 'stdafx.cc')
+env['PCH'] = pch
+env['PCHSTOP'] = 'stdafx.h'
+env.Append(CCPCHFLAGS = ['/FIstdafx.h'])
+
+env.ChromeStaticLibrary('sandbox', input_files + [obj])