Disable test_isolation_mode, glib, and x11 in GYP_DEFINES

This removes unnecessary library dependencies.

Change-Id: Id451766d1bedd7fbcd9cf9cf882de86ccb662486
This commit is contained in:
Kongqun Yang 2014-02-26 20:26:16 -08:00 committed by KongQun Yang
parent b9f1996b68
commit 374324b042
4 changed files with 27 additions and 11 deletions

View File

@ -14,12 +14,12 @@
# 1. Setup gyp: ./gyp_packager.py # 1. Setup gyp: ./gyp_packager.py
# #
# clang is not enabled by default, which can be enabled by overriding # clang is not enabled by default, which can be enabled by overriding
# GYP_DEFINE environment variable, i.e. "GYP_DEFINES='clang=1 # GYP_DEFINE environment variable, i.e.
# use_openssl=1' ./gyp_packager.py". # "GYP_DEFINES='clang=1' ./gyp_packager.py".
# #
# Ninja is the default build system. User can also change to make by # Ninja is the default build system. User can also change to make by
# overriding GYP_GENERATORS to make, i.e. "GYP_GENERATORS='make' # overriding GYP_GENERATORS to make, i.e.
# ./gyp_packager.py". # "GYP_GENERATORS='make' ./gyp_packager.py".
# #
# 2. The first step generates the make files but does not start the # 2. The first step generates the make files but does not start the
# build process. Ninja is the default build system. Refer to Ninja # build process. Ninja is the default build system. Refer to Ninja
@ -59,9 +59,16 @@ if __name__ == '__main__':
# Gyp should run from current directory. # Gyp should run from current directory.
args.append('--depth=.') args.append('--depth=.')
# Set GYP_DEFINES if it is not explicitly set yet. # Set these default GYP_DEFINES if user does not set the value explicitly.
if not os.environ.get('GYP_DEFINES'): _DEFAULT_DEFINES = {"test_isolation_mode" : "noop", "use_glib" : 0,
os.environ['GYP_DEFINES'] = 'use_openssl=1' "use_openssl" : 1, "use_x11" : 0}
gyp_defines = (os.environ['GYP_DEFINES'] if os.environ.get('GYP_DEFINES')
else "")
for key in _DEFAULT_DEFINES:
if key not in gyp_defines:
gyp_defines += " {}={}".format(key, _DEFAULT_DEFINES[key])
os.environ['GYP_DEFINES'] = gyp_defines.strip()
# There shouldn't be a circular dependency relationship between .gyp files, # There shouldn't be a circular dependency relationship between .gyp files,
# but in Chromium's .gyp files, on non-Mac platforms, circular relationships # but in Chromium's .gyp files, on non-Mac platforms, circular relationships

View File

@ -38,9 +38,9 @@
], ],
'dependencies': [ 'dependencies': [
'../../base/base.gyp:base', '../../base/base.gyp:base',
'../../base/base.gyp:run_all_unittests',
'../../mpd/mpd.gyp:media_info_proto', '../../mpd/mpd.gyp:media_info_proto',
'../../testing/gtest.gyp:gtest', '../../testing/gtest.gyp:gtest',
'../../testing/gtest.gyp:gtest_main',
# Depends on full protobuf to read/write with TextFormat. # Depends on full protobuf to read/write with TextFormat.
'../../third_party/protobuf/protobuf.gyp:protobuf_full_do_not_use', '../../third_party/protobuf/protobuf.gyp:protobuf_full_do_not_use',
'../file/file.gyp:file', '../file/file.gyp:file',

View File

@ -12,16 +12,25 @@
}, },
'targets': [ 'targets': [
{ {
'target_name': 'media_test_support', 'target_name': 'run_all_unittests',
'type': '<(component)', 'type': '<(component)',
'sources': [ 'sources': [
'run_tests_with_atexit_manager.cc', 'run_tests_with_atexit_manager.cc',
],
'dependencies': [
'../../testing/gtest.gyp:gtest',
],
},
{
'target_name': 'media_test_support',
'type': '<(component)',
'sources': [
'test_data_util.cc', 'test_data_util.cc',
'test_data_util.h', 'test_data_util.h',
], ],
'dependencies': [ 'dependencies': [
'../../base/base.gyp:base', '../../base/base.gyp:base',
'../../testing/gtest.gyp:gtest', 'run_all_unittests',
], ],
}, },
], ],

View File

@ -68,8 +68,8 @@
], ],
'dependencies': [ 'dependencies': [
'../base/base.gyp:base', '../base/base.gyp:base',
'../base/base.gyp:run_all_unittests',
'../media/file/file.gyp:file', '../media/file/file.gyp:file',
'../media/test/media_test.gyp:run_all_unittests',
'../testing/gtest.gyp:gtest', '../testing/gtest.gyp:gtest',
'mpd_builder', 'mpd_builder',
'mpd_util', 'mpd_util',