Backed out 6 changesets (bug 1371485) for failing spidermonkey build on a CLOSED TREE

Backed out changeset 9578824cbdde (bug 1371485)
Backed out changeset 36bca079ba29 (bug 1371485)
Backed out changeset c205b5921de8 (bug 1371485)
Backed out changeset 17fc0da77821 (bug 1371485)
Backed out changeset da14dc867e22 (bug 1371485)
Backed out changeset 7b604564918d (bug 1371485)
This commit is contained in:
Andreea Pavel 2018-06-27 21:10:15 +03:00
parent b539cac2ee
commit 00c91fc905
1694 changed files with 3371 additions and 993 deletions

View File

@ -14,7 +14,6 @@ mozilla.pth:third_party/python/cram
mozilla.pth:third_party/python/dlmanager
mozilla.pth:third_party/python/fluent
mozilla.pth:third_party/python/futures
mozilla.pth:third_party/python/gyp/pylib
mozilla.pth:third_party/python/python-hglib
mozilla.pth:third_party/python/jsmin
optional:setup.py:third_party/python/psutil:build_ext:--inplace
@ -61,6 +60,7 @@ mozilla.pth:testing/xpcshell
mozilla.pth:third_party/python/mock-1.0.0
mozilla.pth:xpcom/typelib/xpt/tools
mozilla.pth:tools/docs
mozilla.pth:media/webrtc/trunk/tools/gyp/pylib
mozilla.pth:third_party/python/cbor2
mozilla.pth:third_party/python/pyasn1
mozilla.pth:third_party/python/pyasn1-modules

View File

@ -0,0 +1,716 @@
# Copyright (c) 2012 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.
{
'targets': [
{
'target_name': 'All',
'type': 'none',
'xcode_create_dependents_test_runner': 1,
'dependencies': [
'some.gyp:*',
'../base/base.gyp:*',
'../content/content.gyp:*',
'../crypto/crypto.gyp:*',
'../media/media.gyp:*',
'../net/net.gyp:*',
'../sdch/sdch.gyp:*',
'../sql/sql.gyp:*',
'../testing/gmock.gyp:*',
'../testing/gtest.gyp:*',
'../third_party/bzip2/bzip2.gyp:*',
'../third_party/libxml/libxml.gyp:*',
'../third_party/sqlite/sqlite.gyp:*',
'../third_party/zlib/zlib.gyp:*',
'../ui/ui.gyp:*',
'../webkit/support/webkit_support.gyp:*',
'temp_gyp/googleurl.gyp:*',
],
'conditions': [
['OS!="ios"', {
'dependencies': [
'../cc/cc_tests.gyp:*',
'../chrome/chrome.gyp:*',
'../gpu/gpu.gyp:*',
'../gpu/tools/tools.gyp:*',
'../ipc/ipc.gyp:*',
'../jingle/jingle.gyp:*',
'../ppapi/ppapi.gyp:*',
'../ppapi/ppapi_internal.gyp:*',
'../printing/printing.gyp:*',
'../skia/skia.gyp:*',
'../sync/sync.gyp:*',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:*',
'../third_party/cld/cld.gyp:*',
'../third_party/codesighs/codesighs.gyp:*',
'../third_party/ffmpeg/ffmpeg.gyp:*',
'../third_party/iccjpeg/iccjpeg.gyp:*',
'../third_party/libpng/libpng.gyp:*',
'../third_party/libusb/libusb.gyp:*',
'../third_party/libwebp/libwebp.gyp:*',
'../third_party/libxslt/libxslt.gyp:*',
'../third_party/lzma_sdk/lzma_sdk.gyp:*',
'../third_party/mesa/mesa.gyp:*',
'../third_party/modp_b64/modp_b64.gyp:*',
'../third_party/npapi/npapi.gyp:*',
'../third_party/ots/ots.gyp:*',
'../third_party/qcms/qcms.gyp:*',
'../third_party/re2/re2.gyp:re2',
'../third_party/WebKit/Source/WebKit/chromium/All.gyp:*',
'../v8/tools/gyp/v8.gyp:*',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:*',
'../webkit/webkit.gyp:*',
'<(libjpeg_gyp_path):*',
],
}],
['os_posix==1 and OS!="android" and OS!="ios"', {
'dependencies': [
'../third_party/yasm/yasm.gyp:*#host',
],
}],
['OS=="mac" or OS=="ios" or OS=="win"', {
'dependencies': [
'../third_party/nss/nss.gyp:*',
],
}],
['OS=="win" or OS=="ios" or OS=="linux"', {
'dependencies': [
'../breakpad/breakpad.gyp:*',
],
}],
['OS=="mac"', {
'dependencies': [
'../third_party/ocmock/ocmock.gyp:*',
],
}],
['OS=="linux"', {
'dependencies': [
'../courgette/courgette.gyp:*',
'../dbus/dbus.gyp:*',
'../sandbox/sandbox.gyp:*',
],
'conditions': [
['branding=="Chrome"', {
'dependencies': [
'../chrome/chrome.gyp:linux_packages_<(channel)',
],
}],
['chromeos==0', {
'dependencies': [
'../third_party/cros_dbus_cplusplus/cros_dbus_cplusplus.gyp:*',
],
}],
],
}],
['(toolkit_uses_gtk==1) and (build_with_mozilla==0)', {
'dependencies': [
'../tools/gtk_clipboard_dump/gtk_clipboard_dump.gyp:*',
'../tools/xdisplaycheck/xdisplaycheck.gyp:*',
],
}],
['OS=="win"', {
'conditions': [
['win_use_allocator_shim==1', {
'dependencies': [
'../base/allocator/allocator.gyp:*',
],
}],
],
'dependencies': [
'../chrome_frame/chrome_frame.gyp:*',
'../cloud_print/cloud_print.gyp:*',
'../courgette/courgette.gyp:*',
'../rlz/rlz.gyp:*',
'../sandbox/sandbox.gyp:*',
'../third_party/angle/src/build_angle.gyp:*',
'../third_party/bsdiff/bsdiff.gyp:*',
'../third_party/bspatch/bspatch.gyp:*',
'../third_party/gles2_book/gles2_book.gyp:*',
'../tools/memory_watcher/memory_watcher.gyp:*',
],
}, {
'dependencies': [
'../third_party/libevent/libevent.gyp:*',
],
}],
['toolkit_views==1', {
'dependencies': [
'../ui/views/controls/webview/webview.gyp:*',
'../ui/views/views.gyp:*',
],
}],
['use_aura==1', {
'dependencies': [
'../ash/ash.gyp:*',
'../ui/aura/aura.gyp:*',
'../ui/oak/oak.gyp:*',
],
}],
['remoting==1', {
'dependencies': [
'../remoting/remoting.gyp:*',
],
}],
['use_openssl==0', {
'dependencies': [
'../net/third_party/nss/ssl.gyp:*',
],
}],
],
}, # target_name: All
{
'target_name': 'All_syzygy',
'type': 'none',
'conditions': [
['OS=="win" and fastbuild==0', {
'dependencies': [
'../chrome/installer/mini_installer_syzygy.gyp:*',
],
},
],
],
}, # target_name: All_syzygy
{
'target_name': 'chromium_builder_tests',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../sql/sql.gyp:sql_unittests',
'../ui/ui.gyp:ui_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
'conditions': [
['OS!="ios"', {
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../gpu/gles2_conform_support/gles2_conform_support.gyp:gles2_conform_support',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
],
}],
['OS=="win"', {
'dependencies': [
'../chrome/chrome.gyp:installer_util_unittests',
'../chrome/chrome.gyp:mini_installer_test',
# mini_installer_tests depends on mini_installer. This should be
# defined in installer.gyp.
'../chrome/installer/mini_installer.gyp:mini_installer',
'../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_perftests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_unittests',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
'../courgette/courgette.gyp:courgette_unittests',
'../sandbox/sandbox.gyp:sbox_integration_tests',
'../sandbox/sandbox.gyp:sbox_unittests',
'../sandbox/sandbox.gyp:sbox_validation_tests',
'../webkit/webkit.gyp:pull_in_copy_TestNetscapePlugIn',
'../ui/views/views.gyp:views_unittests',
'../webkit/webkit.gyp:test_shell_common',
],
}],
['OS=="linux"', {
'dependencies': [
'../sandbox/sandbox.gyp:sandbox_linux_unittests',
],
}],
],
}, # target_name: chromium_builder_tests
{
'target_name': 'chromium_2010_builder_tests',
'type': 'none',
'dependencies': [
'chromium_builder_tests',
],
}, # target_name: chromium_2010_builder_tests
],
'conditions': [
['OS!="ios"', {
'targets': [
{
'target_name': 'chromium_builder_nacl_win_integration',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for pyauto
'chromium_builder_tests',
],
}, # target_name: chromium_builder_nacl_win_integration
{
'target_name': 'chromium_builder_perf',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for pyauto
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:sync_performance_tests',
],
}, # target_name: chromium_builder_perf
{
'target_name': 'chromium_gpu_builder',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:gpu_tests',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../gpu/gpu.gyp:gl_tests',
],
'conditions': [
['internal_gles2_conform_tests', {
'dependencies': [
'../gpu/gles2_conform_test/gles2_conform_test.gyp:gles2_conform_test',
],
}], # internal_gles2_conform
],
}, # target_name: chromium_gpu_builder
{
'target_name': 'chromium_gpu_debug_builder',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:gpu_tests',
'../gpu/gpu.gyp:gl_tests',
],
'conditions': [
['internal_gles2_conform_tests', {
'dependencies': [
'../gpu/gles2_conform_test/gles2_conform_test.gyp:gles2_conform_test',
],
}], # internal_gles2_conform
],
}, # target_name: chromium_gpu_debug_builder
{
'target_name': 'chromium_builder_qa',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:chromedriver',
# Dependencies of pyauto_functional tests.
'../remoting/remoting.gyp:remoting_webapp',
],
# not needed for Mozilla
# 'conditions': [
# # If you change this condition, make sure you also change it
# # in chrome_tests.gypi
# ['enable_automation==1 and (OS=="mac" or OS=="win" or (os_posix==1 and target_arch==python_arch))', {
# 'dependencies': [
# '../chrome/chrome.gyp:pyautolib',
# ],
# }],
['OS=="mac"', {
'dependencies': [
'../remoting/remoting.gyp:remoting_me2me_host_archive',
],
}],
['OS=="win" and component != "shared_library" and wix_exists == "True" and sas_dll_exists == "True"', {
'dependencies': [
'../remoting/remoting.gyp:remoting_host_installation',
],
}],
],
}, # target_name: chromium_builder_qa
{
'target_name': 'chromium_builder_perf_av',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for perf pyauto tests
'../webkit/webkit.gyp:pull_in_DumpRenderTree', # to run layout tests
],
}, # target_name: chromium_builder_perf_av
], # targets
}],
['OS=="mac"', {
'targets': [
{
# Target to build everything plus the dmg. We don't put the dmg
# in the All target because developers really don't need it.
'target_name': 'all_and_dmg',
'type': 'none',
'dependencies': [
'All',
'../chrome/chrome.gyp:build_app_dmg',
],
},
# These targets are here so the build bots can use them to build
# subsets of a full tree for faster cycle times.
{
'target_name': 'chromium_builder_dbg',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../ui/ui.gyp:ui_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../rlz/rlz.gyp:*',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_rel',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../ui/ui.gyp:ui_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_dbg_tsan_mac',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
'../net/net.gyp:net_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
],
},
{
'target_name': 'chromium_builder_asan_mac',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:chrome',
'../net/net.gyp:dns_fuzz_stub',
'../webkit/webkit.gyp:pull_in_DumpRenderTree',
],
},
{
'target_name': 'chromium_builder_dbg_valgrind_mac',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:unit_tests',
'../content/content.gyp:content_unittests',
'../ui/ui.gyp:ui_unittests',
'../jingle/jingle.gyp:jingle_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
], # targets
}], # OS="mac"
['OS=="win"', {
'targets': [
# These targets are here so the build bots can use them to build
# subsets of a full tree for faster cycle times.
{
'target_name': 'chromium_builder',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:installer_util_unittests',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:mini_installer_test',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
# mini_installer_tests depends on mini_installer. This should be
# defined in installer.gyp.
'../chrome/installer/mini_installer.gyp:mini_installer',
'../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_perftests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_unittests',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
'../courgette/courgette.gyp:courgette_unittests',
'../ui/ui.gyp:ui_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'../ui/views/views.gyp:views_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'../webkit/webkit.gyp:pull_in_copy_TestNetscapePlugIn',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_win_cf',
'type': 'none',
'dependencies': [
'../chrome_frame/chrome_frame.gyp:chrome_frame_net_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_perftests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_reliability_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_tests',
'../chrome_frame/chrome_frame.gyp:chrome_frame_unittests',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
],
},
{
'target_name': 'chromium_builder_dbg_tsan_win',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'chromium_builder_dbg_drmemory_win',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests',
'../chrome/chrome.gyp:unit_tests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../content/content.gyp:content_unittests',
'../crypto/crypto.gyp:crypto_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../jingle/jingle.gyp:jingle_unittests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../printing/printing.gyp:printing_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../sql/sql.gyp:sql_unittests',
'../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_unittests',
'../third_party/libphonenumber/libphonenumber.gyp:libphonenumber_unittests',
'temp_gyp/googleurl.gyp:googleurl_unittests',
],
},
{
'target_name': 'webkit_builder_win',
'type': 'none',
'dependencies': [
'../webkit/webkit.gyp:test_shell',
'../webkit/webkit.gyp:test_shell_tests',
'../webkit/webkit.gyp:pull_in_webkit_unit_tests',
'../webkit/webkit.gyp:pull_in_DumpRenderTree',
],
},
{
'target_name': 'chromium_builder_qa_nacl_win64',
'type': 'none',
'dependencies': [
'chromium_builder_qa', # needed for pyauto
'../chrome/chrome.gyp:chrome_nacl_win64',
],
}, # target_name: chromium_builder_qa_nacl_win64
], # targets
'conditions': [
['branding=="Chrome"', {
'targets': [
{
'target_name': 'chrome_official_builder',
'type': 'none',
'dependencies': [
'../chrome/chrome.gyp:chromedriver',
'../chrome/chrome.gyp:crash_service',
'../chrome/chrome.gyp:crash_service_win64',
'../chrome/chrome.gyp:performance_ui_tests',
'../chrome/chrome.gyp:policy_templates',
'../chrome/chrome.gyp:pyautolib',
'../chrome/chrome.gyp:reliability_tests',
'../chrome/chrome.gyp:automated_ui_tests',
'../chrome/installer/mini_installer.gyp:mini_installer',
'../chrome_frame/chrome_frame.gyp:npchrome_frame',
'../courgette/courgette.gyp:courgette',
'../courgette/courgette.gyp:courgette64',
'../cloud_print/cloud_print.gyp:cloud_print',
'../remoting/remoting.gyp:remoting_webapp',
'../third_party/adobe/flash/flash_player.gyp:flash_player',
'../third_party/widevine/cdm/widevine_cdm.gyp:widevinecdmplugin',
],
'conditions': [
['internal_pdf', {
'dependencies': [
'../pdf/pdf.gyp:pdf',
],
}], # internal_pdf
['component != "shared_library" and wix_exists == "True" and \
sas_dll_exists == "True"', {
'dependencies': [
'../remoting/remoting.gyp:remoting_host_installation',
],
}], # component != "shared_library"
]
},
], # targets
}], # branding=="Chrome"
], # conditions
}], # OS="win"
['use_aura==1', {
'targets': [
{
'target_name': 'aura_builder',
'type': 'none',
'dependencies': [
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:chrome',
'../chrome/chrome.gyp:interactive_ui_tests',
'../chrome/chrome.gyp:unit_tests',
'../content/content.gyp:content_browsertests',
'../content/content.gyp:content_unittests',
'../ppapi/ppapi_internal.gyp:ppapi_unittests',
'../remoting/remoting.gyp:remoting_unittests',
'../ui/aura/aura.gyp:*',
'../ui/compositor/compositor.gyp:*',
'../ui/ui.gyp:ui_unittests',
'../ui/views/views.gyp:views',
'../ui/views/views.gyp:views_unittests',
'../webkit/compositor_bindings/compositor_bindings_tests.gyp:webkit_compositor_bindings_unittests',
'../webkit/webkit.gyp:pull_in_webkit_unit_tests',
],
'conditions': [
['OS=="win"', {
# Remove this when we have the real compositor.
'copies': [
{
'destination': '<(PRODUCT_DIR)',
'files': ['../third_party/directxsdk/files/dlls/D3DX10d_43.dll']
},
],
'dependencies': [
'../content/content.gyp:content_unittests',
'../chrome/chrome.gyp:crash_service',
'../chrome/chrome.gyp:crash_service_win64',
],
}],
['use_ash==1', {
'dependencies': [
'../ash/ash.gyp:ash_shell',
'../ash/ash.gyp:ash_unittests',
],
}],
['OS=="linux"', {
# Tests that currently only work on Linux.
'dependencies': [
'../base/base.gyp:base_unittests',
'../content/content.gyp:content_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
],
}],
['OS=="mac"', {
# Exclude dependencies that are not currently implemented.
'dependencies!': [
'../chrome/chrome.gyp:chrome',
'../chrome/chrome.gyp:unit_tests',
'../ui/views/views.gyp:views_unittests',
],
}],
['chromeos==1', {
'dependencies': [
'../chromeos/chromeos.gyp:chromeos_unittests',
],
}],
],
},
], # targets
}], # "use_aura==1"
['test_isolation_mode != "noop"', {
'targets': [
{
'target_name': 'chromium_swarm_tests',
'type': 'none',
'dependencies': [
'../base/base.gyp:base_unittests_run',
'../chrome/chrome.gyp:browser_tests_run',
'../chrome/chrome.gyp:unit_tests_run',
'../net/net.gyp:net_unittests_run',
],
}, # target_name: chromium_swarm_tests
],
}],
], # conditions
}

View File

@ -0,0 +1,115 @@
# Copyright (c) 2012 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.
# This is all.gyp file for Android to prevent breakage in Android and other
# platform; It will be churning a lot in the short term and eventually be merged
# into all.gyp.
{
'variables': {
# A hook that can be overridden in other repositories to add additional
# compilation targets to 'All'
'android_app_targets%': [],
},
'targets': [
{
'target_name': 'All',
'type': 'none',
'dependencies': [
'../content/content.gyp:content_shell_apk',
'<@(android_app_targets)',
'android_builder_tests',
'../android_webview/android_webview.gyp:android_webview_apk',
'../chrome/chrome.gyp:chromium_testshell',
],
}, # target_name: All
{
# The current list of tests for android. This is temporary
# until the full set supported. If adding a new test here,
# please also add it to build/android/run_tests.py, else the
# test is not run.
#
# WARNING:
# Do not add targets here without communicating the implications
# on tryserver triggers and load. Discuss with jrg please.
'target_name': 'android_builder_tests',
'type': 'none',
'dependencies': [
'../base/android/jni_generator/jni_generator.gyp:jni_generator_tests',
'../base/base.gyp:base_unittests',
'../cc/cc_tests.gyp:cc_unittests',
'../chrome/chrome.gyp:unit_tests',
'../content/content.gyp:content_shell_test_apk',
'../content/content.gyp:content_unittests',
'../gpu/gpu.gyp:gpu_unittests',
'../ipc/ipc.gyp:ipc_tests',
'../media/media.gyp:media_unittests',
'../net/net.gyp:net_unittests',
'../sql/sql.gyp:sql_unittests',
'../sync/sync.gyp:sync_unit_tests',
'../third_party/WebKit/Source/WebKit/chromium/All.gyp:*',
'../tools/android/device_stats_monitor/device_stats_monitor.gyp:device_stats_monitor',
'../tools/android/fake_dns/fake_dns.gyp:fake_dns',
'../tools/android/forwarder2/forwarder.gyp:forwarder2',
'../tools/android/md5sum/md5sum.gyp:md5sum',
'../ui/ui.gyp:ui_unittests',
# From here down: not added to run_tests.py yet.
'../jingle/jingle.gyp:jingle_unittests',
# Required by ui_unittests.
# TODO(wangxianzhu): It'd better let ui_unittests depend on it, but
# this would cause circular gyp dependency which needs refactoring the
# gyps to resolve.
'../chrome/chrome_resources.gyp:packed_resources',
],
'conditions': [
['linux_breakpad==1', {
'dependencies': [
'../breakpad/breakpad.gyp:breakpad_unittests',
],
}],
['"<(gtest_target_type)"=="shared_library"', {
'dependencies': [
# The first item is simply the template. We add as a dep
# to make sure it builds in ungenerated form. TODO(jrg):
# once stable, transition to a test-only (optional)
# target.
'../testing/android/native_test.gyp:native_test_apk',
# Unit test bundles packaged as an apk.
'../base/base.gyp:base_unittests_apk',
'../cc/cc_tests.gyp:cc_unittests_apk',
'../chrome/chrome.gyp:unit_tests_apk',
'../content/content.gyp:content_unittests_apk',
'../gpu/gpu.gyp:gpu_unittests_apk',
'../ipc/ipc.gyp:ipc_tests_apk',
'../media/media.gyp:media_unittests_apk',
'../net/net.gyp:net_unittests_apk',
'../sql/sql.gyp:sql_unittests_apk',
'../sync/sync.gyp:sync_unit_tests_apk',
'../ui/ui.gyp:ui_unittests_apk',
'../android_webview/android_webview.gyp:android_webview_test_apk',
'../chrome/chrome.gyp:chromium_testshell_test_apk',
],
}],
],
},
{
# Experimental / in-progress targets that are expected to fail
# but we still try to compile them on bots (turning the stage
# orange, not red).
'target_name': 'android_experimental',
'type': 'none',
'dependencies': [
],
},
{
# In-progress targets that are expected to fail and are NOT run
# on any bot.
'target_name': 'android_in_progress',
'type': 'none',
'dependencies': [
'../content/content.gyp:content_browsertests',
],
},
], # targets
}

View File

@ -0,0 +1,6 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#dummy gypi: contents should be discarded due to an enclosing 'conditions:' element.
{}

View File

@ -0,0 +1,75 @@
# Copyright (c) 2012 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.
# This file is meant to be included into a target to provide a rule
# to build APK based test suites.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'test_suite_name_apk',
# 'type': 'none',
# 'variables': {
# 'test_suite_name': 'test_suite_name', # string
# 'input_shlib_path' : '/path/to/test_suite.so', # string
# 'input_jars_paths': ['/path/to/test_suite.jar', ... ], # list
# },
# 'includes': ['path/to/this/gypi/file'],
# }
#
{
'variables': {
'input_jars_paths': [
# Needed by ChromeNativeTestActivity.java.
'<(PRODUCT_DIR)/lib.java/chromium_base.jar',
],
},
'target_conditions': [
['_toolset == "target"', {
'conditions': [
['OS == "android" and gtest_target_type == "shared_library"', {
'actions': [{
'action_name': 'apk_<(test_suite_name)',
'message': 'Building <(test_suite_name) test apk.',
'inputs': [
'<(DEPTH)/testing/android/AndroidManifest.xml',
'<(DEPTH)/testing/android/generate_native_test.py',
'<(input_shlib_path)',
'>@(input_jars_paths)',
],
'outputs': [
'<(PRODUCT_DIR)/<(test_suite_name)_apk/<(test_suite_name)-debug.apk',
],
'action': [
'<(DEPTH)/testing/android/generate_native_test.py',
'--native_library',
'<(input_shlib_path)',
'--jars',
'">@(input_jars_paths)"',
'--output',
'<(PRODUCT_DIR)/<(test_suite_name)_apk',
'--strip-binary=<(android_strip)',
'--app_abi',
'<(android_app_abi)',
'--ant-args',
'-DPRODUCT_DIR=<(ant_build_out)',
'--ant-args',
'-DANDROID_SDK=<(android_sdk)',
'--ant-args',
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
'--ant-args',
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
'--ant-args',
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
'--ant-args',
'-DANDROID_GDBSERVER=<(android_gdbserver)',
'--ant-args',
'-DCHROMIUM_SRC=<(ant_build_out)/../..',
],
}],
}], # 'OS == "android" and gtest_target_type == "shared_library"
], # conditions
}],
], # target_conditions
}

View File

@ -1177,7 +1177,7 @@
# Enable Keystone auto-update support.
'mac_keystone%': 1,
}, { # else: branding!="Chrome" or buildtype!="Official"
'mac_sdk%': '', #'<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
'mac_sdk%': '<!(<(PYTHON) <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
'mac_breakpad_uploads%': 0,
'mac_breakpad%': 0,
'mac_keystone%': 0,

View File

@ -0,0 +1,29 @@
# Copyright (c) 2012 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.
# This GYP file should be included for every target in Chromium that is built
# using the NaCl toolchain.
{
'includes': [
'../native_client/build/untrusted.gypi',
],
'target_defaults': {
'conditions': [
['target_arch=="arm"', {
'variables': {
'clang': 1,
},
'defines': [
# Needed by build/build_config.h processor architecture detection.
'__ARMEL__',
# Needed by base/third_party/nspr/prtime.cc.
'__arm__',
# Disable ValGrind. The assembly code it generates causes the build
# to fail.
'NVALGRIND',
],
}],
],
},
}

View File

@ -0,0 +1,48 @@
# Copyright (c) 2012 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.
# This file is meant to be included into an action to copy test data files into
# an iOS app bundle. To use this the following variables need to be defined:
# test_data_files: list: paths to test data files or directories
# test_data_prefix: string: a directory prefix that will be prepended to each
# output path. Generally, this should be the base
# directory of the gypi file containing the unittest
# target (e.g. "base" or "chrome").
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_unittests',
# 'conditions': [
# ['OS == "ios"', {
# 'actions': [
# {
# 'action_name': 'copy_test_data',
# 'variables': {
# 'test_data_files': [
# 'path/to/datafile.txt',
# 'path/to/data/directory/',
# ]
# 'test_data_prefix' : 'prefix',
# },
# 'includes': ['path/to/this/gypi/file'],
# },
# ],
# }],
# }
#
{
'inputs': [
'<!@pymod_do_main(copy_test_data_ios --inputs <(test_data_files))',
],
'outputs': [
'<!@pymod_do_main(copy_test_data_ios -o <(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix) --outputs <(test_data_files))',
],
'action': [
'python',
'<(DEPTH)/build/copy_test_data_ios.py',
'-o', '<(PRODUCT_DIR)/<(_target_name).app/<(test_data_prefix)',
'<(_inputs)',
],
}

View File

@ -0,0 +1,33 @@
# Copyright (c) 2011 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.
# This file is meant to be included into an action to invoke grit in a
# consistent manner. To use this the following variables need to be
# defined:
# grit_grd_file: string: grd file path
# grit_out_dir: string: the output directory path
# It would be really nice to do this with a rule instead of actions, but it
# would need to determine inputs and outputs via grit_info on a per-file
# basis. GYP rules dont currently support that. They could be extended to
# do this, but then every generator would need to be updated to handle this.
{
'variables': {
'grit_cmd': ['python', '<(DEPTH)/tools/grit/grit.py'],
},
'inputs': [
'<!@pymod_do_main(grit_info <@(grit_defines) --inputs <(grit_grd_file))',
],
'outputs': [
'<!@pymod_do_main(grit_info <@(grit_defines) --outputs \'<(grit_out_dir)\' <(grit_grd_file))',
],
'action': ['<@(grit_cmd)',
'-i', '<(grit_grd_file)', 'build',
'-fGRIT_DIR/../gritsettings/resource_ids',
'-o', '<(grit_out_dir)',
'<@(grit_defines)' ],
'msvs_cygwin_shell': 0,
'message': 'Generating resources from <(grit_grd_file)',
}

View File

@ -0,0 +1,30 @@
# Copyright (c) 2011 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.
# This file is meant to be included into a target that will have one or more
# uses of grit_action.gypi. To use this the following variables need to be
# defined:
# grit_out_dir: string: the output directory path
# NOTE: This file is optional, not all targets that use grit include it, some
# do their own custom directives instead.
{
'conditions': [
# If the target is a direct binary, it needs to be able to find the header,
# otherwise it probably a supporting target just for grit so the include
# dir needs to be set on anything that depends on this action.
['_type=="executable" or _type=="shared_library" or \
_type=="loadable_module" or _type=="static_library"', {
'include_dirs': [
'<(grit_out_dir)',
],
}, {
'direct_dependent_settings': {
'include_dirs': [
'<(grit_out_dir)',
],
},
}],
],
}

View File

@ -0,0 +1,12 @@
#!/usr/bin/env python
# Copyright (c) 2012 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.
# Simple launcher script for gyp_chromium.py.
# TODO(sbc): This should probably be shell script but for historical
# reasons (all the python code used to live in this script without a
# .py extension, and was often run as 'python gyp_chromium') it is
# currently still python.
execfile(__file__ + '.py')

View File

@ -0,0 +1,68 @@
# Copyright (c) 2012 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.
"""This script is now only used by the closure_compilation builders."""
import argparse
import glob
import gyp_environment
import os
import shlex
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib'))
import gyp
def ProcessGypDefinesItems(items):
"""Converts a list of strings to a list of key-value pairs."""
result = []
for item in items:
tokens = item.split('=', 1)
# Some GYP variables have hyphens, which we don't support.
if len(tokens) == 2:
result += [(tokens[0], tokens[1])]
else:
# No value supplied, treat it as a boolean and set it. Note that we
# use the string '1' here so we have a consistent definition whether
# you do 'foo=1' or 'foo'.
result += [(tokens[0], '1')]
return result
def GetSupplementalFiles():
return []
def GetGypVars(_):
"""Returns a dictionary of all GYP vars."""
# GYP defines from the environment.
env_items = ProcessGypDefinesItems(
shlex.split(os.environ.get('GYP_DEFINES', '')))
# GYP defines from the command line.
parser = argparse.ArgumentParser()
parser.add_argument('-D', dest='defines', action='append', default=[])
cmdline_input_items = parser.parse_known_args()[0].defines
cmdline_items = ProcessGypDefinesItems(cmdline_input_items)
return dict(env_items + cmdline_items)
def main():
gyp_environment.SetEnvironment()
print 'Updating projects from gyp files...'
sys.stdout.flush()
sys.exit(gyp.main(sys.argv[1:] + [
'--check',
'--no-circular-check',
'-I', os.path.join(script_dir, 'common.gypi'),
'-D', 'gyp_output_dir=out']))
if __name__ == '__main__':
sys.exit(main())

View File

@ -0,0 +1,30 @@
# Copyright 2014 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.
"""
Sets up various automatic gyp environment variables. These are used by
gyp_chromium and landmines.py which run at different stages of runhooks. To
make sure settings are consistent between them, all setup should happen here.
"""
import gyp_helper
import os
import sys
import vs_toolchain
def SetEnvironment():
"""Sets defaults for GYP_* variables."""
gyp_helper.apply_chromium_gyp_env()
# Default to ninja on linux and windows, but only if no generator has
# explicitly been set.
# Also default to ninja on mac, but only when not building chrome/ios.
# . -f / --format has precedence over the env var, no need to check for it
# . set the env var only if it hasn't been set yet
# . chromium.gyp_env has been applied to os.environ at this point already
if sys.platform.startswith(('linux', 'win', 'freebsd', 'darwin')) and \
not os.environ.get('GYP_GENERATORS'):
os.environ['GYP_GENERATORS'] = 'ninja'
vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()

View File

@ -0,0 +1,68 @@
# Copyright (c) 2012 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.
# This file helps gyp_chromium and landmines correctly set up the gyp
# environment from chromium.gyp_env on disk
import os
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CHROME_SRC = os.path.dirname(SCRIPT_DIR)
def apply_gyp_environment_from_file(file_path):
"""Reads in a *.gyp_env file and applies the valid keys to os.environ."""
if not os.path.exists(file_path):
return
with open(file_path, 'rU') as f:
file_contents = f.read()
try:
file_data = eval(file_contents, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = os.path.abspath(file_path)
raise
supported_vars = (
'CC',
'CC_wrapper',
'CC.host_wrapper',
'CHROMIUM_GYP_FILE',
'CHROMIUM_GYP_SYNTAX_CHECK',
'CXX',
'CXX_wrapper',
'CXX.host_wrapper',
'GYP_DEFINES',
'GYP_GENERATOR_FLAGS',
'GYP_CROSSCOMPILE',
'GYP_GENERATOR_OUTPUT',
'GYP_GENERATORS',
'GYP_INCLUDE_FIRST',
'GYP_INCLUDE_LAST',
'GYP_MSVS_VERSION',
)
for var in supported_vars:
file_val = file_data.get(var)
if file_val:
if var in os.environ:
behavior = 'replaces'
if var == 'GYP_DEFINES':
result = file_val + ' ' + os.environ[var]
behavior = 'merges with, and individual components override,'
else:
result = os.environ[var]
print 'INFO: Environment value for "%s" %s value in %s' % (
var, behavior, os.path.abspath(file_path)
)
string_padding = max(len(var), len(file_path), len('result'))
print ' %s: %s' % (var.rjust(string_padding), os.environ[var])
print ' %s: %s' % (file_path.rjust(string_padding), file_val)
os.environ[var] = result
else:
os.environ[var] = file_val
def apply_chromium_gyp_env():
if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ:
# Update the environment based on chromium.gyp_env
path = os.path.join(os.path.dirname(CHROME_SRC), 'chromium.gyp_env')
apply_gyp_environment_from_file(path)

View File

@ -0,0 +1,191 @@
# Copyright 2014 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.
"""Converts a given gypi file to a python scope and writes the result to stdout.
USING THIS SCRIPT IN CHROMIUM
Forking Python to run this script in the middle of GN is slow, especially on
Windows, and it makes both the GYP and GN files harder to follow. You can't
use "git grep" to find files in the GN build any more, and tracking everything
in GYP down requires a level of indirection. Any calls will have to be removed
and cleaned up once the GYP-to-GN transition is complete.
As a result, we only use this script when the list of files is large and
frequently-changing. In these cases, having one canonical list outweights the
downsides.
As of this writing, the GN build is basically complete. It's likely that all
large and frequently changing targets where this is appropriate use this
mechanism already. And since we hope to turn down the GYP build soon, the time
horizon is also relatively short. As a result, it is likely that no additional
uses of this script should every be added to the build. During this later part
of the transition period, we should be focusing more and more on the absolute
readability of the GN build.
HOW TO USE
It is assumed that the file contains a toplevel dictionary, and this script
will return that dictionary as a GN "scope" (see example below). This script
does not know anything about GYP and it will not expand variables or execute
conditions.
It will strip conditions blocks.
A variables block at the top level will be flattened so that the variables
appear in the root dictionary. This way they can be returned to the GN code.
Say your_file.gypi looked like this:
{
'sources': [ 'a.cc', 'b.cc' ],
'defines': [ 'ENABLE_DOOM_MELON' ],
}
You would call it like this:
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("your_file.gypi") ],
"scope",
[ "your_file.gypi" ])
Notes:
- The rebase_path call converts the gypi file from being relative to the
current build file to being system absolute for calling the script, which
will have a different current directory than this file.
- The "scope" parameter tells GN to interpret the result as a series of GN
variable assignments.
- The last file argument to exec_script tells GN that the given file is a
dependency of the build so Ninja can automatically re-run GN if the file
changes.
Read the values into a target like this:
component("mycomponent") {
sources = gypi_values.sources
defines = gypi_values.defines
}
Sometimes your .gypi file will include paths relative to a different
directory than the current .gn file. In this case, you can rebase them to
be relative to the current directory.
sources = rebase_path(gypi_values.sources, ".",
"//path/gypi/input/values/are/relative/to")
This script will tolerate a 'variables' in the toplevel dictionary or not. If
the toplevel dictionary just contains one item called 'variables', it will be
collapsed away and the result will be the contents of that dictinoary. Some
.gypi files are written with or without this, depending on how they expect to
be embedded into a .gyp file.
This script also has the ability to replace certain substrings in the input.
Generally this is used to emulate GYP variable expansion. If you passed the
argument "--replace=<(foo)=bar" then all instances of "<(foo)" in strings in
the input will be replaced with "bar":
gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("your_file.gypi"),
"--replace=<(foo)=bar"],
"scope",
[ "your_file.gypi" ])
"""
import gn_helpers
from optparse import OptionParser
import sys
def LoadPythonDictionary(path):
file_string = open(path).read()
try:
file_data = eval(file_string, {'__builtins__': None}, None)
except SyntaxError, e:
e.filename = path
raise
except Exception, e:
raise Exception("Unexpected error while reading %s: %s" % (path, str(e)))
assert isinstance(file_data, dict), "%s does not eval to a dictionary" % path
# Flatten any variables to the top level.
if 'variables' in file_data:
file_data.update(file_data['variables'])
del file_data['variables']
# Strip all elements that this script can't process.
elements_to_strip = [
'conditions',
'target_conditions',
'targets',
'includes',
'actions',
]
for element in elements_to_strip:
if element in file_data:
del file_data[element]
return file_data
def ReplaceSubstrings(values, search_for, replace_with):
"""Recursively replaces substrings in a value.
Replaces all substrings of the "search_for" with "repace_with" for all
strings occurring in "values". This is done by recursively iterating into
lists as well as the keys and values of dictionaries."""
if isinstance(values, str):
return values.replace(search_for, replace_with)
if isinstance(values, list):
return [ReplaceSubstrings(v, search_for, replace_with) for v in values]
if isinstance(values, dict):
# For dictionaries, do the search for both the key and values.
result = {}
for key, value in values.items():
new_key = ReplaceSubstrings(key, search_for, replace_with)
new_value = ReplaceSubstrings(value, search_for, replace_with)
result[new_key] = new_value
return result
# Assume everything else is unchanged.
return values
def main():
parser = OptionParser()
parser.add_option("-r", "--replace", action="append",
help="Replaces substrings. If passed a=b, replaces all substrs a with b.")
(options, args) = parser.parse_args()
if len(args) != 1:
raise Exception("Need one argument which is the .gypi file to read.")
data = LoadPythonDictionary(args[0])
if options.replace:
# Do replacements for all specified patterns.
for replace in options.replace:
split = replace.split('=')
# Allow "foo=" to replace with nothing.
if len(split) == 1:
split.append('')
assert len(split) == 2, "Replacement must be of the form 'key=value'."
data = ReplaceSubstrings(data, split[0], split[1])
# Sometimes .gypi files use the GYP syntax with percents at the end of the
# variable name (to indicate not to overwrite a previously-defined value):
# 'foo%': 'bar',
# Convert these to regular variables.
for key in data:
if len(key) > 1 and key[len(key) - 1] == '%':
data[key[:-1]] = data[key]
del data[key]
print gn_helpers.ToGNString(data)
if __name__ == '__main__':
try:
main()
except Exception, e:
print str(e)
sys.exit(1)

View File

@ -0,0 +1,79 @@
# Copyright (c) 2012 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.
# Xcode throws an error if an iOS target depends on a Mac OS X target. So
# any place a utility program needs to be build and run, an action is
# used to run ninja as script to work around this.
# Example:
# {
# 'target_name': 'foo',
# 'type': 'none',
# 'variables': {
# # The name of a directory used for ninja. This cannot be shared with
# # another mac build.
# 'ninja_output_dir': 'ninja-foo',
# # The list of all the gyp files that contain the targets to run.
# 're_run_targets': [
# 'foo.gyp',
# ],
# },
# 'includes': ['path_to/mac_build.gypi'],
# 'actions': [
# {
# 'action_name': 'compile foo',
# 'inputs': [],
# 'outputs': [],
# 'action': [
# '<@(ninja_cmd)',
# # All the targets to build.
# 'foo1',
# 'foo2',
# ],
# },
# ],
# }
{
'variables': {
# Convenience variable pointing to the ninja product directory.
'ninja_product_dir':
'<(DEPTH)/xcodebuild/<(ninja_output_dir)/<(CONFIGURATION_NAME)',
# Common ninja command line flags.
'ninja_cmd': [
# Bounce through clean_env to clean up the environment so things
# set by the iOS build don't pollute the Mac build.
'<(DEPTH)/build/ios/clean_env.py',
# ninja must be found in the PATH.
'ADD_TO_PATH=<!(echo $PATH)',
'ninja',
'-C',
'<(ninja_product_dir)',
],
# Common syntax to rerun gyp to generate the Mac projects.
're_run_gyp': [
'build/gyp_chromium',
# Don't use anything set for the iOS side of things.
'--ignore-environment',
# Generate for ninja
'--format=ninja',
# Generate files into xcodebuild/ninja
'-Goutput_dir=xcodebuild/<(ninja_output_dir)',
# nacl isn't in the iOS checkout, make sure it's turned off
'-Ddisable_nacl=1',
# Add a variable to handle specific cases for mac_build.
'-Dios_mac_build=1',
# Pass through the Mac SDK version.
'-Dmac_sdk=<(mac_sdk)',
],
# Rerun gyp for each of the projects needed. This is what actually
# generates the projects on disk.
're_run_gyp_execution':
'<!(cd <(DEPTH) && <@(re_run_gyp) <@(re_run_targets))',
},
# Since these are used to generate things needed by other targets, make
# them hard dependencies so they are always built first.
'hard_dependency': 1,
}

View File

@ -0,0 +1,53 @@
# Copyright (c) 2012 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.
# This file is meant to be included into a target to provide a rule
# to generate jni bindings for system Java-files in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'android_jar_jni_headers',
# 'type': 'none',
# 'variables': {
# 'jni_gen_dir': 'chrome',
# 'input_java_class': 'java/io/InputStream.class',
# 'input_jar_file': '<(android_sdk)/android.jar',
# },
# 'includes': [ '../build/jar_file_jni_generator.gypi' ],
# },
{
'variables': {
'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
},
'actions': [
{
'action_name': 'generate_jni_headers_from_jar_file',
'inputs': [
'<(jni_generator)',
'<(input_jar_file)',
],
'variables': {
'java_class_name': '<!(basename <(input_java_class)|sed "s/\.class//")'
},
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni/<(java_class_name)_jni.h',
],
'action': [
'<(jni_generator)',
'-j',
'<(input_jar_file)',
'--input_file',
'<(input_java_class)',
'--output_dir',
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni',
],
'message': 'Generating JNI bindings from <(input_jar_file)/<(input_java_class)',
'process_outputs_as_sources': 1,
},
],
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

View File

@ -0,0 +1,90 @@
# Copyright (c) 2012 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.
# This file is meant to be included into a target to provide a rule
# to build Java in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my-package_java',
# 'type': 'none',
# 'variables': {
# 'package_name': 'my-package',
# 'java_in_dir': 'path/to/package/root',
# },
# 'includes': ['path/to/this/gypi/file'],
# }
#
# The generated jar-file will be:
# <(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar
# Required variables:
# package_name - Used to name the intermediate output directory and in the
# names of some output files.
# java_in_dir - The top-level java directory. The src should be in
# <java_in_dir>/src.
# Optional/automatic variables:
# additional_input_paths - These paths will be included in the 'inputs' list to
# ensure that this target is rebuilt when one of these paths changes.
# additional_src_dirs - Additional directories with .java files to be compiled
# and included in the output of this target.
# generated_src_dirs - Same as additional_src_dirs except used for .java files
# that are generated at build time. This should be set automatically by a
# target's dependencies. The .java files in these directories are not
# included in the 'inputs' list (unlike additional_src_dirs).
# input_jars_paths - The path to jars to be included in the classpath. This
# should be filled automatically by depending on the appropriate targets.
{
'dependencies': [
'<(DEPTH)/build/build_output_dirs_android.gyp:build_output_dirs'
],
# This all_dependent_settings is used for java targets only. This will add the
# chromium_<(package_name) jar to the classpath of dependent java targets.
'all_dependent_settings': {
'variables': {
'input_jars_paths': ['<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar'],
},
},
'variables': {
'input_jars_paths': [],
'additional_src_dirs': [],
'additional_input_paths': [],
'generated_src_dirs': [],
},
'actions': [
{
'action_name': 'ant_<(package_name)',
'message': 'Building <(package_name) java sources.',
'inputs': [
'android/ant/common.xml',
'android/ant/chromium-jars.xml',
'>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")',
'>@(input_jars_paths)',
'>@(additional_input_paths)',
],
'outputs': [
'<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar',
],
'action': [
'ant',
'-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
'-DANDROID_SDK=<(android_sdk)',
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
'-DANDROID_GDBSERVER=<(android_gdbserver)',
'-DPRODUCT_DIR=<(ant_build_out)',
'-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)',
'-DGENERATED_SRC_DIRS=>(generated_src_dirs)',
'-DINPUT_JARS_PATHS=>(input_jars_paths)',
'-DPACKAGE_NAME=<(package_name)',
'-Dbasedir=<(java_in_dir)',
'-buildfile',
'<(DEPTH)/build/android/ant/chromium-jars.xml'
]
},
],
}

View File

@ -0,0 +1,58 @@
# Copyright (c) 2012 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.
# This file is meant to be included into a target to provide a rule
# to build Java aidl files in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'aidl_aidl-file-name',
# 'type': 'none',
# 'variables': {
# 'package_name': <name-of-package>
# 'aidl_interface_file': '<interface-path>/<interface-file>.aidl',
# },
# 'sources': {
# '<input-path1>/<input-file1>.aidl',
# '<input-path2>/<input-file2>.aidl',
# ...
# },
# 'includes': ['<path-to-this-file>/java_aidl.gypi'],
# }
#
#
# The generated java files will be:
# <(PRODUCT_DIR)/lib.java/<input-file1>.java
# <(PRODUCT_DIR)/lib.java/<input-file2>.java
# ...
#
# TODO(cjhopman): dependents need to rebuild when this target's inputs have changed.
{
'direct_dependent_settings': {
'variables': {
'generated_src_dirs': ['<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/'],
},
},
'rules': [
{
'rule_name': 'compile_aidl',
'extension': 'aidl',
'inputs': [
'<(android_sdk)/framework.aidl',
'<(aidl_interface_file)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
],
'action': [
'<(android_sdk_tools)/aidl',
'-p<(android_sdk)/framework.aidl',
'-p<(aidl_interface_file)',
'<(RULE_INPUT_PATH)',
'<(SHARED_INTERMEDIATE_DIR)/<(package_name)/aidl/<(RULE_INPUT_ROOT).java',
],
},
],
}

View File

@ -0,0 +1,58 @@
# Copyright (c) 2012 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.
# This file is meant to be included into a target to provide a rule
# to generate jni bindings for Java-files in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'base_jni_headers',
# 'type': 'none',
# 'sources': [
# 'android/java/src/org/chromium/base/BuildInfo.java',
# ...
# ...
# 'android/java/src/org/chromium/base/SystemMessageHandler.java',
# ],
# 'variables': {
# 'jni_gen_dir': 'base',
# },
# 'includes': [ '../build/jni_generator.gypi' ],
# },
#
# The generated file name pattern can be seen on the "outputs" section below.
# (note that RULE_INPUT_ROOT is the basename for the java file).
#
# See base/android/jni_generator/jni_generator.py for more info about the
# format of generating JNI bindings.
{
'variables': {
'jni_generator': '<(DEPTH)/base/android/jni_generator/jni_generator.py',
},
'rules': [
{
'rule_name': 'generate_jni_headers',
'extension': 'java',
'inputs': [
'<(jni_generator)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni/<(RULE_INPUT_ROOT)_jni.h',
],
'action': [
'<(jni_generator)',
'--input_file',
'<(RULE_INPUT_PATH)',
'--output_dir',
'<(SHARED_INTERMEDIATE_DIR)/<(jni_gen_dir)/jni',
],
'message': 'Generating JNI bindings from <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,
},
],
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

View File

@ -0,0 +1,62 @@
# Copyright (c) 2012 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.
{
'variables': {
# When including this gypi, the following variables must be set:
# idl_schema_files: an array of idl files that comprise the api model.
# cc_dir: path to generated files
# root_namespace: the C++ namespace that all generated files go under
# Functions and namespaces can be excluded by setting "nocompile" to true.
'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
'api_gen': '<(api_gen_dir)/compiler.py',
},
'actions': [
{
'action_name': 'genapi_bundle',
'inputs': [
'<(api_gen_dir)/cc_generator.py',
'<(api_gen_dir)/code.py',
'<(api_gen_dir)/compiler.py',
'<(api_gen_dir)/cpp_type_generator.py',
'<(api_gen_dir)/cpp_util.py',
'<(api_gen_dir)/h_generator.py',
'<(api_gen_dir)/idl_schema.py',
'<(api_gen_dir)/json_schema.py',
'<(api_gen_dir)/model.py',
'<(api_gen_dir)/schema_bundle_generator.py',
'<(api_gen_dir)/util_cc_helper.py',
'<@(idl_schema_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_api.h',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.h',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/generated_schemas.cc',
],
'action': [
'python',
'<(api_gen)',
'--root=<(DEPTH)',
'--destdir=<(SHARED_INTERMEDIATE_DIR)',
'--namespace=<(root_namespace)',
'--bundle',
'<@(idl_schema_files)',
],
'message': 'Generating C++ API bundle code',
'process_outputs_as_sources': 1,
}
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
'<(DEPTH)',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
]
},
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

View File

@ -0,0 +1,110 @@
# Copyright (c) 2012 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.
{
'variables': {
# When including this gypi, the following variables must be set:
# json_schema_files: a list of json files that comprise the api model.
# idl_schema_files: a list of IDL files that comprise the api model.
# cc_dir: path to generated files
# root_namespace: the C++ namespace that all generated files go under
# Functions and namespaces can be excluded by setting "nocompile" to true.
'api_gen_dir': '<(DEPTH)/tools/json_schema_compiler',
'api_gen': '<(api_gen_dir)/compiler.py',
},
'rules': [
{
'rule_name': 'genapi',
'extension': 'json',
'inputs': [
'<(api_gen_dir)/any.cc',
'<(api_gen_dir)/any.h',
'<(api_gen_dir)/any_helper.py',
'<(api_gen_dir)/cc_generator.py',
'<(api_gen_dir)/code.py',
'<(api_gen_dir)/compiler.py',
'<(api_gen_dir)/cpp_type_generator.py',
'<(api_gen_dir)/cpp_util.py',
'<(api_gen_dir)/h_generator.py',
'<(api_gen_dir)/json_schema.py',
'<(api_gen_dir)/model.py',
'<(api_gen_dir)/util.cc',
'<(api_gen_dir)/util.h',
'<(api_gen_dir)/util_cc_helper.py',
# TODO(calamity): uncomment this when gyp on windows behaves like other
# platforms. List expansions of filepaths in inputs expand to different
# things.
# '<@(json_schema_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
],
'action': [
'python',
'<(api_gen)',
'<(RULE_INPUT_PATH)',
'--root=<(DEPTH)',
'--destdir=<(SHARED_INTERMEDIATE_DIR)',
'--namespace=<(root_namespace)',
],
'message': 'Generating C++ code from <(RULE_INPUT_PATH) json files',
'process_outputs_as_sources': 1,
},
{
'rule_name': 'genapi_idl',
'msvs_external_rule': 1,
'extension': 'idl',
'inputs': [
'<(api_gen_dir)/any.cc',
'<(api_gen_dir)/any.h',
'<(api_gen_dir)/any_helper.py',
'<(api_gen_dir)/cc_generator.py',
'<(api_gen_dir)/code.py',
'<(api_gen_dir)/compiler.py',
'<(api_gen_dir)/cpp_type_generator.py',
'<(api_gen_dir)/cpp_util.py',
'<(api_gen_dir)/h_generator.py',
'<(api_gen_dir)/idl_schema.py',
'<(api_gen_dir)/model.py',
'<(api_gen_dir)/util.cc',
'<(api_gen_dir)/util.h',
'<(api_gen_dir)/util_cc_helper.py',
# TODO(calamity): uncomment this when gyp on windows behaves like other
# platforms. List expansions of filepaths in inputs expand to different
# things.
# '<@(idl_schema_files)',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).cc',
'<(SHARED_INTERMEDIATE_DIR)/<(cc_dir)/<(RULE_INPUT_ROOT).h',
],
'action': [
'python',
'<(api_gen)',
'<(RULE_INPUT_PATH)',
'--root=<(DEPTH)',
'--destdir=<(SHARED_INTERMEDIATE_DIR)',
'--namespace=<(root_namespace)',
],
'message': 'Generating C++ code from <(RULE_INPUT_PATH) IDL files',
'process_outputs_as_sources': 1,
},
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
'<(DEPTH)',
],
'dependencies':[
'<(DEPTH)/tools/json_schema_compiler/api_gen_util.gyp:api_gen_util',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)',
]
},
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

View File

@ -0,0 +1,96 @@
# Copyright (c) 2011 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.
# This file is meant to be included into an target to create a unittest that
# invokes a set of no-compile tests. A no-compile test is a test that asserts
# a particular construct will not compile.
#
# Also see:
# http://dev.chromium.org/developers/testing/no-compile-tests
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_module_nc_unittests',
# 'type': 'executable',
# 'sources': [
# 'nc_testset_1.nc',
# 'nc_testset_2.nc',
# ],
# 'includes': ['path/to/this/gypi/file'],
# }
#
# The .nc files are C++ files that contain code we wish to assert will not
# compile. Each individual test case in the file should be put in its own
# #ifdef section. The expected output should be appended with a C++-style
# comment that has a python list of regular expressions. This will likely
# be greater than 80-characters. Giving a solid expected output test is
# important so that random compile failures do not cause the test to pass.
#
# Example .nc file:
#
# #if defined(TEST_NEEDS_SEMICOLON) // [r"expected ',' or ';' at end of input"]
#
# int a = 1
#
# #elif defined(TEST_NEEDS_CAST) // [r"invalid conversion from 'void*' to 'char*'"]
#
# void* a = NULL;
# char* b = a;
#
# #endif
#
# If we needed disable TEST_NEEDS_SEMICOLON, then change the define to:
#
# DISABLE_TEST_NEEDS_SEMICOLON
# TEST_NEEDS_CAST
#
# The lines above are parsed by a regexp so avoid getting creative with the
# formatting or ifdef logic; it will likely just not work.
#
# Implementation notes:
# The .nc files are actually processed by a python script which executes the
# compiler and generates a .cc file that is empty on success, or will have a
# series of #error lines on failure, and a set of trivially passing gunit
# TEST() functions on success. This allows us to fail at the compile step when
# something goes wrong, and know during the unittest run that the test was at
# least processed when things go right.
{
# TODO(awong): Disabled until http://crbug.com/105388 is resolved.
'sources/': [['exclude', '\\.nc$']],
'conditions': [
[ 'OS=="linux" and clang==0', {
'rules': [
{
'variables': {
'nocompile_driver': '<(DEPTH)/tools/nocompile_driver.py',
'nc_result_path': ('<(INTERMEDIATE_DIR)/<(module_dir)/'
'<(RULE_INPUT_ROOT)_nc.cc'),
},
'rule_name': 'run_nocompile',
'extension': 'nc',
'inputs': [
'<(nocompile_driver)',
],
'outputs': [
'<(nc_result_path)'
],
'action': [
'python',
'<(nocompile_driver)',
'4', # number of compilers to invoke in parallel.
'<(RULE_INPUT_PATH)',
'-Wall -Werror -Wfatal-errors -I<(DEPTH)',
'<(nc_result_path)',
],
'message': 'Generating no compile results for <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,
},
],
}, {
'sources/': [['exclude', '\\.nc$']]
}], # 'OS=="linux" and clang=="0"'
],
}

View File

@ -0,0 +1,116 @@
# Copyright (c) 2012 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.
# This file is meant to be included into a target to provide a rule
# to invoke protoc in a consistent manner.
#
# To use this, create a gyp target with the following form:
# {
# 'target_name': 'my_proto_lib',
# 'type': 'static_library',
# 'sources': [
# 'foo.proto',
# 'bar.proto',
# ],
# 'variables': {
# # Optional, see below: 'proto_in_dir': '.'
# 'proto_out_dir': 'dir/for/my_proto_lib'
# },
# 'includes': ['path/to/this/gypi/file'],
# }
# If necessary, you may add normal .cc files to the sources list or other gyp
# dependencies. The proto headers are guaranteed to be generated before any
# source files, even within this target, are compiled.
#
# The 'proto_in_dir' variable must be the relative path to the
# directory containing the .proto files. If left out, it defaults to '.'.
#
# The 'proto_out_dir' variable specifies the path suffix that output
# files are generated under. Targets that gyp-depend on my_proto_lib
# will be able to include the resulting proto headers with an include
# like:
# #include "dir/for/my_proto_lib/foo.pb.h"
#
# If you need to add an EXPORT macro to a protobuf's c++ header, set the
# 'cc_generator_options' variable with the value: 'dllexport_decl=FOO_EXPORT:'
# e.g. 'dllexport_decl=BASE_EXPORT:'
#
# It is likely you also need to #include a file for the above EXPORT macro to
# work. You can do so with the 'cc_include' variable.
# e.g. 'base/base_export.h'
#
# Implementation notes:
# A proto_out_dir of foo/bar produces
# <(SHARED_INTERMEDIATE_DIR)/protoc_out/foo/bar/{file1,file2}.pb.{cc,h}
# <(SHARED_INTERMEDIATE_DIR)/pyproto/foo/bar/{file1,file2}_pb2.py
{
'variables': {
'protoc_wrapper': '<(DEPTH)/tools/protoc_wrapper/protoc_wrapper.py',
'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)',
'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)',
'cc_generator_options%': '',
'cc_include%': '',
'proto_in_dir%': '.',
},
'rules': [
{
'rule_name': 'genproto',
'extension': 'proto',
'inputs': [
'<(protoc_wrapper)',
'<(protoc)',
],
'outputs': [
'<(py_dir)/<(RULE_INPUT_ROOT)_pb2.py',
'<(cc_dir)/<(RULE_INPUT_ROOT).pb.cc',
'<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
],
'action': [
'python',
'<(protoc_wrapper)',
'--include',
'<(cc_include)',
'--protobuf',
'<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
'--',
'<(protoc)',
# Using the --arg val form (instead of --arg=val) allows gyp's msvs rule
# generation to correct 'val' which is a path.
'--proto_path','<(proto_in_dir)',
# Naively you'd use <(RULE_INPUT_PATH) here, but protoc requires
# --proto_path is a strict prefix of the path given as an argument.
'<(proto_in_dir)/<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)',
'--cpp_out', '<(cc_generator_options)<(cc_dir)',
'--python_out', '<(py_dir)',
],
'msvs_cygwin_shell': 0,
'message': 'Generating C++ and Python code from <(RULE_INPUT_PATH)',
'process_outputs_as_sources': 1,
},
],
'dependencies': [
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
],
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/protoc_out',
'<(DEPTH)',
],
'direct_dependent_settings': {
'include_dirs': [
'<(SHARED_INTERMEDIATE_DIR)/protoc_out',
'<(DEPTH)',
]
},
'export_dependent_settings': [
# The generated headers reference headers within protobuf_lite,
# so dependencies must be able to find those headers too.
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
],
# This target exports a hard dependency because it generates header
# files.
'hard_dependency': 1,
}

View File

@ -0,0 +1,24 @@
# Copyright (c) 2011 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.
{
'targets': [
{
'target_name': 'some',
'type': 'none',
'dependencies': [
# This file is intended to be locally modified. List the targets you use
# regularly. The generated some.sln will contains projects for only
# those targets and the targets they are transitively dependent on. This
# can result in a solution that loads and unloads faster in Visual
# Studio.
#
# Tip: Create a dummy CL to hold your local edits to this file, so they
# don't accidentally get added to another CL that you are editing.
#
# Example:
# '../chrome/chrome.gyp:chrome',
],
},
],
}

View File

@ -0,0 +1,3 @@
This directory will be removed once the files in it are committed upstream and
Chromium imports an upstream revision with these files. Contact mark for
details.

View File

@ -0,0 +1,105 @@
# Copyright (c) 2012 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.
# TODO(mark): Upstream this file to googleurl.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'googleurl',
'type': '<(component)',
'dependencies': [
'../../base/base.gyp:base',
'../../third_party/icu/icu.gyp:icudata',
'../../third_party/icu/icu.gyp:icui18n',
'../../third_party/icu/icu.gyp:icuuc',
],
'sources': [
'../../googleurl/src/gurl.cc',
'../../googleurl/src/gurl.h',
'../../googleurl/src/url_canon.h',
'../../googleurl/src/url_canon_etc.cc',
'../../googleurl/src/url_canon_fileurl.cc',
'../../googleurl/src/url_canon_filesystemurl.cc',
'../../googleurl/src/url_canon_host.cc',
'../../googleurl/src/url_canon_icu.cc',
'../../googleurl/src/url_canon_icu.h',
'../../googleurl/src/url_canon_internal.cc',
'../../googleurl/src/url_canon_internal.h',
'../../googleurl/src/url_canon_internal_file.h',
'../../googleurl/src/url_canon_ip.cc',
'../../googleurl/src/url_canon_ip.h',
'../../googleurl/src/url_canon_mailtourl.cc',
'../../googleurl/src/url_canon_path.cc',
'../../googleurl/src/url_canon_pathurl.cc',
'../../googleurl/src/url_canon_query.cc',
'../../googleurl/src/url_canon_relative.cc',
'../../googleurl/src/url_canon_stdstring.h',
'../../googleurl/src/url_canon_stdurl.cc',
'../../googleurl/src/url_file.h',
'../../googleurl/src/url_parse.cc',
'../../googleurl/src/url_parse.h',
'../../googleurl/src/url_parse_file.cc',
'../../googleurl/src/url_parse_internal.h',
'../../googleurl/src/url_util.cc',
'../../googleurl/src/url_util.h',
],
'direct_dependent_settings': {
'include_dirs': [
'../..',
],
},
'defines': [
'FULL_FILESYSTEM_URL_SUPPORT=1',
],
'conditions': [
['component=="shared_library"', {
'defines': [
'GURL_DLL',
'GURL_IMPLEMENTATION=1',
],
'direct_dependent_settings': {
'defines': [
'GURL_DLL',
],
},
}],
],
},
{
'target_name': 'googleurl_unittests',
'type': 'executable',
'dependencies': [
'googleurl',
'../../base/base.gyp:base_i18n',
'../../base/base.gyp:run_all_unittests',
'../../testing/gtest.gyp:gtest',
'../../third_party/icu/icu.gyp:icuuc',
],
'sources': [
'../../googleurl/src/gurl_unittest.cc',
'../../googleurl/src/url_canon_unittest.cc',
'../../googleurl/src/url_parse_unittest.cc',
'../../googleurl/src/url_test_utils.h',
'../../googleurl/src/url_util_unittest.cc',
],
'defines': [
'FULL_FILESYSTEM_URL_SUPPORT=1',
],
'conditions': [
['os_posix==1 and OS!="mac" and OS!="ios"', {
'conditions': [
['linux_use_tcmalloc==1', {
'dependencies': [
'../../base/allocator/allocator.gyp:allocator',
],
}],
],
}],
],
},
],
}

View File

@ -0,0 +1,40 @@
# Copyright (c) 2009 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.
{
'targets': [
{
'target_name': 'pdfsqueeze',
'type': 'executable',
'sources': [
'../../third_party/pdfsqueeze/pdfsqueeze.m',
],
'defines': [
# Use defines to map the full path names that will be used for
# the vars into the short forms expected by pdfsqueeze.m.
'______third_party_pdfsqueeze_ApplyGenericRGB_qfilter=ApplyGenericRGB_qfilter',
'______third_party_pdfsqueeze_ApplyGenericRGB_qfilter_len=ApplyGenericRGB_qfilter_len',
],
'include_dirs': [
'<(INTERMEDIATE_DIR)',
],
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
'$(SDKROOT)/System/Library/Frameworks/Quartz.framework',
],
'actions': [
{
'action_name': 'Generate inline filter data',
'inputs': [
'../../third_party/pdfsqueeze/ApplyGenericRGB.qfilter',
],
'outputs': [
'<(INTERMEDIATE_DIR)/ApplyGenericRGB.h',
],
'action': ['xxd', '-i', '<@(_inputs)', '<@(_outputs)'],
},
],
},
],
}

View File

@ -0,0 +1,20 @@
# Copyright (c) 2011 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.
# Include this file to make targets in your .gyp use the default
# precompiled header on Windows, in debug builds only as the official
# builders blow up (out of memory) if precompiled headers are used for
# release builds.
{
'conditions': [
['OS=="win" and chromium_win_pch==1', {
'target_defaults': {
'msvs_precompiled_header': '<(DEPTH)/build/precompile.h',
'msvs_precompiled_source': '<(DEPTH)/build/precompile.cc',
'sources': ['<(DEPTH)/build/precompile.cc'],
}
}],
],
}

View File

@ -0,0 +1,9 @@
# This is a dummy gyp file to satisfy libjingle.gyp.
{
'targets': [
{
'target_name': 'net',
'type': 'none',
},
],
}

View File

@ -0,0 +1,165 @@
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
'includes': [
'webrtc/build/common.gypi',
'webrtc/video/webrtc_video.gypi',
],
'variables': {
'peerconnection_sample': 'third_party/libjingle/source/talk/examples/peerconnection',
},
# for mozilla, we want to force stuff to build but we don't want peerconnection_client or server
# for unknown reasons, 'targets' must be outside of conditions. And don't try to build a dummy
# executable...
'targets': [
{
'conditions': [
['build_with_mozilla==1', {
'target_name': 'dummy',
'type': 'none',
'dependencies': [
'webrtc/webrtc.gyp:webrtc_lib',
'webrtc/modules/modules.gyp:audio_device',
'webrtc/modules/modules.gyp:video_capture_module',
'webrtc/modules/modules.gyp:video_capture_module_internal_impl',
# TODO: missing?
# 'webrtc/modules/modules.gyp:video_render',
# 'webrtc/system_wrappers/source/system_wrappers.gyp:system_wrappers',
# 'webrtc/system_wrappers/source/system_wrappers.gyp:metrics_default',
# 'webrtc/video_engine/video_engine.gyp:video_engine_core',
'webrtc/voice_engine/voice_engine.gyp:voice_engine',
# '<@(webrtc_video_dependencies)',
],
'conditions': [
['OS!="android" and OS!="ios"', {
'dependencies': [
'webrtc/modules/modules.gyp:desktop_capture',
],
},
]],
}, ],
],
}, ],
'conditions': [
['build_with_mozilla==0', {
'targets': [
{
'target_name': 'peerconnection_server',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/server/data_socket.cc',
'<(peerconnection_sample)/server/data_socket.h',
'<(peerconnection_sample)/server/main.cc',
'<(peerconnection_sample)/server/peer_channel.cc',
'<(peerconnection_sample)/server/peer_channel.h',
'<(peerconnection_sample)/server/utils.cc',
'<(peerconnection_sample)/server/utils.h',
],
'include_dirs': [
'third_party/libjingle/source',
],
}, ],
'conditions': [
# TODO(wu): Merge the target for different platforms.
['OS=="win"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/client/conductor.cc',
'<(peerconnection_sample)/client/conductor.h',
'<(peerconnection_sample)/client/defaults.cc',
'<(peerconnection_sample)/client/defaults.h',
'<(peerconnection_sample)/client/main.cc',
'<(peerconnection_sample)/client/main_wnd.cc',
'<(peerconnection_sample)/client/main_wnd.h',
'<(peerconnection_sample)/client/peer_connection_client.cc',
'<(peerconnection_sample)/client/peer_connection_client.h',
'third_party/libjingle/source/talk/base/win32socketinit.cc',
'third_party/libjingle/source/talk/base/win32socketserver.cc',
],
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '2', # Windows
},
},
'dependencies': [
#'third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
#'third_party/libjingle/libjingle.gyp:libjingle_peerconnection',
],
'include_dirs': [
'src',
'webrtc/modules/interface',
'third_party/libjingle/source',
],
},
], # targets
}, ], # OS="win"
['OS=="linux"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'executable',
'sources': [
'<(peerconnection_sample)/client/conductor.cc',
'<(peerconnection_sample)/client/conductor.h',
'<(peerconnection_sample)/client/defaults.cc',
'<(peerconnection_sample)/client/defaults.h',
'<(peerconnection_sample)/client/linux/main.cc',
'<(peerconnection_sample)/client/linux/main_wnd.cc',
'<(peerconnection_sample)/client/linux/main_wnd.h',
'<(peerconnection_sample)/client/peer_connection_client.cc',
'<(peerconnection_sample)/client/peer_connection_client.h',
],
'dependencies': [
#'third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
#'third_party/libjingle/libjingle.gyp:libjingle_peerconnection',
# TODO(tommi): Switch to this and remove specific gtk dependency
# sections below for cflags and link_settings.
# '<(DEPTH)/build/linux/system.gyp:gtk',
],
'include_dirs': [
'third_party/libjingle/source',
],
'cflags': [
'<!@(pkg-config --cflags gtk+-2.0)',
],
'link_settings': {
'ldflags': [
'<!@(pkg-config --libs-only-L --libs-only-other gtk+-2.0 gthread-2.0)',
],
'libraries': [
'<!@(pkg-config --libs-only-l gtk+-2.0 gthread-2.0)',
'-lX11',
'-lXcomposite',
'-lXext',
'-lXrender',
],
},
},
], # targets
}, ], # OS="linux"
# There's no peerconnection_client implementation for Mac.
# But add this dummy peerconnection_client target so that the runhooks
# won't complain.
['OS=="mac"', {
'targets': [
{
'target_name': 'peerconnection_client',
'type': 'none',
},
],
}, ],
],
}, ],
],
}

View File

@ -0,0 +1,30 @@
# This file will be picked up by gyp to initialize some global settings.
{
'variables': {
# make sure we can override this with --include
'build_with_chromium%': 1,
'clang_use_chrome_plugins%': 0,
'enable_protobuf%': 1,
'enabled_libjingle_device_manager%': 1,
'include_internal_audio_device%': 1,
'include_internal_video_capture%': 1,
'include_internal_video_render%': 1,
'include_pulse_audio%': 1,
'use_openssl%': 1,
},
'target_defaults': {
'conditions': [
['OS=="linux" and clang==1', {
'cflags': [
# Suppress the warning caused by
# LateBindingSymbolTable::TableInfo from
# latebindingsymboltable.cc.def.
'-Wno-address-of-array-temporary',
],
'cflags_mozilla': [
'-Wno-address-of-array-temporary',
],
}],
],
}, # target_defaults
}

View File

@ -14,7 +14,7 @@
{
'variables': {
'gflags_root': '/media/webrtc/trunk/third_party/gflags',
'gflags_root': '<(DEPTH)/third_party/gflags',
'conditions': [
['OS=="win"', {
'gflags_gen_arch_root': '<(gflags_root)/gen/win',

View File

@ -0,0 +1,178 @@
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
'targets': [
{
'target_name': 'opus',
'type': '<(library)',
'defines': [
'OPUS_BUILD',
'FLOATING_POINT',
'VAR_ARRAYS',
],
'conditions': [
['OS=="linux"', {
'cflags': [
'-std=c99',
],
'cflags_mozilla': [
'-std=c99',
],
'defines': [
'HAVE_LRINTF',
],
}]
],
'include_dirs': [
'source/include',
'source/src',
'source/celt',
'source/silk',
'source/silk/float',
],
'sources': [
# opus wrapper/glue
'source/src/opus.c',
'source/src/opus_decoder.c',
'source/src/opus_encoder.c',
'source/src/repacketizer.c',
# celt sub-codec
'source/celt/bands.c',
'source/celt/celt.c',
'source/celt/cwrs.c',
'source/celt/entcode.c',
'source/celt/entdec.c',
'source/celt/entenc.c',
'source/celt/kiss_fft.c',
'source/celt/laplace.c',
'source/celt/mathops.c',
'source/celt/mdct.c',
'source/celt/modes.c',
'source/celt/pitch.c',
'source/celt/celt_lpc.c',
'source/celt/quant_bands.c',
'source/celt/rate.c',
'source/celt/vq.c',
# silk sub-codec
'source/silk/CNG.c',
'source/silk/code_signs.c',
'source/silk/init_decoder.c',
'source/silk/decode_core.c',
'source/silk/decode_frame.c',
'source/silk/decode_parameters.c',
'source/silk/decode_indices.c',
'source/silk/decode_pulses.c',
'source/silk/decoder_set_fs.c',
'source/silk/dec_API.c',
'source/silk/enc_API.c',
'source/silk/encode_indices.c',
'source/silk/encode_pulses.c',
'source/silk/gain_quant.c',
'source/silk/interpolate.c',
'source/silk/LP_variable_cutoff.c',
'source/silk/NLSF_decode.c',
'source/silk/NSQ.c',
'source/silk/NSQ_del_dec.c',
'source/silk/PLC.c',
'source/silk/shell_coder.c',
'source/silk/tables_gain.c',
'source/silk/tables_LTP.c',
'source/silk/tables_NLSF_CB_NB_MB.c',
'source/silk/tables_NLSF_CB_WB.c',
'source/silk/tables_other.c',
'source/silk/tables_pitch_lag.c',
'source/silk/tables_pulses_per_block.c',
'source/silk/VAD.c',
'source/silk/control_audio_bandwidth.c',
'source/silk/quant_LTP_gains.c',
'source/silk/VQ_WMat_EC.c',
'source/silk/HP_variable_cutoff.c',
'source/silk/NLSF_encode.c',
'source/silk/NLSF_VQ.c',
'source/silk/NLSF_unpack.c',
'source/silk/NLSF_del_dec_quant.c',
'source/silk/process_NLSFs.c',
'source/silk/stereo_LR_to_MS.c',
'source/silk/stereo_MS_to_LR.c',
'source/silk/check_control_input.c',
'source/silk/control_SNR.c',
'source/silk/init_encoder.c',
'source/silk/control_codec.c',
'source/silk/A2NLSF.c',
'source/silk/ana_filt_bank_1.c',
'source/silk/biquad_alt.c',
'source/silk/bwexpander_32.c',
'source/silk/bwexpander.c',
'source/silk/debug.c',
'source/silk/decode_pitch.c',
'source/silk/inner_prod_aligned.c',
'source/silk/lin2log.c',
'source/silk/log2lin.c',
'source/silk/LPC_analysis_filter.c',
'source/silk/LPC_inv_pred_gain.c',
'source/silk/table_LSF_cos.c',
'source/silk/NLSF2A.c',
'source/silk/NLSF_stabilize.c',
'source/silk/NLSF_VQ_weights_laroia.c',
'source/silk/pitch_est_tables.c',
'source/silk/resampler.c',
'source/silk/resampler_down2_3.c',
'source/silk/resampler_down2.c',
'source/silk/resampler_private_AR2.c',
'source/silk/resampler_private_down_FIR.c',
'source/silk/resampler_private_IIR_FIR.c',
'source/silk/resampler_private_up2_HQ.c',
'source/silk/resampler_rom.c',
'source/silk/sigm_Q15.c',
'source/silk/sort.c',
'source/silk/sum_sqr_shift.c',
'source/silk/stereo_decode_pred.c',
'source/silk/stereo_encode_pred.c',
'source/silk/stereo_find_predictor.c',
'source/silk/stereo_quant_pred.c',
# silk floating point engine
'source/silk/float/apply_sine_window_FLP.c',
'source/silk/float/corrMatrix_FLP.c',
'source/silk/float/encode_frame_FLP.c',
'source/silk/float/find_LPC_FLP.c',
'source/silk/float/find_LTP_FLP.c',
'source/silk/float/find_pitch_lags_FLP.c',
'source/silk/float/find_pred_coefs_FLP.c',
'source/silk/float/LPC_analysis_filter_FLP.c',
'source/silk/float/LTP_analysis_filter_FLP.c',
'source/silk/float/LTP_scale_ctrl_FLP.c',
'source/silk/float/noise_shape_analysis_FLP.c',
'source/silk/float/prefilter_FLP.c',
'source/silk/float/process_gains_FLP.c',
'source/silk/float/regularize_correlations_FLP.c',
'source/silk/float/residual_energy_FLP.c',
'source/silk/float/solve_LS_FLP.c',
'source/silk/float/warped_autocorrelation_FLP.c',
'source/silk/float/wrappers_FLP.c',
'source/silk/float/autocorrelation_FLP.c',
'source/silk/float/burg_modified_FLP.c',
'source/silk/float/bwexpander_FLP.c',
'source/silk/float/energy_FLP.c',
'source/silk/float/inner_product_FLP.c',
'source/silk/float/k2a_FLP.c',
'source/silk/float/levinsondurbin_FLP.c',
'source/silk/float/LPC_inv_pred_gain_FLP.c',
'source/silk/float/pitch_analysis_core_FLP.c',
'source/silk/float/scale_copy_vector_FLP.c',
'source/silk/float/scale_vector_FLP.c',
'source/silk/float/schur_FLP.c',
'source/silk/float/sort_FLP.c',
]
}
]
}

View File

@ -1,10 +1,9 @@
# Names should be added to this file like so:
# Name or Organization <email address>
Google Inc. <*@google.com>
Bloomberg Finance L.P. <*@bloomberg.net>
IBM Inc. <*@*.ibm.com>
Yandex LLC <*@yandex-team.ru>
Google Inc.
Bloomberg Finance L.P.
Yandex LLC
Steven Knight <knight@baldmt.com>
Ryan Norton <rnorton10@gmail.com>
@ -12,5 +11,3 @@ David J. Sankel <david@sankelsoftware.com>
Eric N. Vander Weele <ericvw@gmail.com>
Tom Freudenberg <th.freudenberg@gmail.com>
Julien Brianceau <jbriance@cisco.com>
Refael Ackermann <refack@gmail.com>
Jiajie Hu <jiajie.hu@intel.com>

View File

@ -73,15 +73,23 @@ PYLINT_DISABLED_WARNINGS = [
]
def _LicenseHeader(input_api):
def CheckChangeOnUpload(input_api, output_api):
report = []
report.extend(input_api.canned_checks.PanProjectChecks(
input_api, output_api))
return report
def CheckChangeOnCommit(input_api, output_api):
report = []
# Accept any year number from 2009 to the current year.
current_year = int(input_api.time.strftime('%Y'))
allowed_years = (str(s) for s in reversed(xrange(2009, current_year + 1)))
years_re = '(' + '|'.join(allowed_years) + ')'
# The (c) is deprecated, but tolerate it until it's removed from all files.
return (
license = (
r'.*? Copyright (\(c\) )?%(year)s Google Inc\. All rights reserved\.\n'
r'.*? Use of this source code is governed by a BSD-style license that '
r'can be\n'
@ -90,18 +98,8 @@ def _LicenseHeader(input_api):
'year': years_re,
}
def CheckChangeOnUpload(input_api, output_api):
report = []
report.extend(input_api.canned_checks.PanProjectChecks(
input_api, output_api, license_header=_LicenseHeader(input_api)))
return report
def CheckChangeOnCommit(input_api, output_api):
report = []
report.extend(input_api.canned_checks.PanProjectChecks(
input_api, output_api, license_header=_LicenseHeader(input_api)))
input_api, output_api, license_header=license))
report.extend(input_api.canned_checks.CheckTreeIsOpen(
input_api, output_api,
'http://gyp-status.appspot.com/status',
@ -124,3 +122,16 @@ def CheckChangeOnCommit(input_api, output_api):
finally:
sys.path = old_sys_path
return report
TRYBOTS = [
'linux_try',
'mac_try',
'win_try',
]
def GetPreferredTryMasters(_, change):
return {
'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS },
}

View File

@ -0,0 +1,10 @@
# This file is used by gcl to get repository specific information.
CODE_REVIEW_SERVER: codereview.chromium.org
CC_LIST: gyp-developer@googlegroups.com
VIEW_VC: https://chromium.googlesource.com/external/gyp/+/
TRY_ON_UPLOAD: False
TRYSERVER_PROJECT: gyp
TRYSERVER_PATCHLEVEL: 1
TRYSERVER_ROOT: gyp
TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl
PROJECT: gyp

View File

@ -2,4 +2,4 @@
@rem Use of this source code is governed by a BSD-style license that can be
@rem found in the LICENSE file.
@python "%~dp0gyp_main.py" %*
@python "%~dp0gyp_main.py" %*

View File

@ -0,0 +1,274 @@
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(object):
"""
Executor class for commands, including "commands" implemented by
Python functions.
"""
verbose = True
active = True
def __init__(self, dictionary={}):
self.subst_dictionary(dictionary)
def subst_dictionary(self, dictionary):
self._subst_dictionary = dictionary
def subst(self, string, dictionary=None):
"""
Substitutes (via the format operator) the values in the specified
dictionary into the specified command.
The command can be an (action, string) tuple. In all cases, we
perform substitution on strings and don't worry if something isn't
a string. (It's probably a Python function to be executed.)
"""
if dictionary is None:
dictionary = self._subst_dictionary
if dictionary:
try:
string = string % dictionary
except TypeError:
pass
return string
def display(self, command, stdout=None, stderr=None):
if not self.verbose:
return
if type(command) == type(()):
func = command[0]
args = command[1:]
s = '%s(%s)' % (func.__name__, ', '.join(map(repr, args)))
if type(command) == type([]):
# TODO: quote arguments containing spaces
# TODO: handle meta characters?
s = ' '.join(command)
else:
s = self.subst(command)
if not s.endswith('\n'):
s += '\n'
sys.stdout.write(s)
sys.stdout.flush()
def execute(self, command, stdout=None, stderr=None):
"""
Executes a single command.
"""
if not self.active:
return 0
if type(command) == type(''):
command = self.subst(command)
cmdargs = shlex.split(command)
if cmdargs[0] == 'cd':
command = (os.chdir,) + tuple(cmdargs[1:])
if type(command) == type(()):
func = command[0]
args = command[1:]
return func(*args)
else:
if stdout is sys.stdout:
# Same as passing sys.stdout, except python2.4 doesn't fail on it.
subout = None
else:
# Open pipe for anything else so Popen works on python2.4.
subout = subprocess.PIPE
if stderr is sys.stderr:
# Same as passing sys.stderr, except python2.4 doesn't fail on it.
suberr = None
elif stderr is None:
# Merge with stdout if stderr isn't specified.
suberr = subprocess.STDOUT
else:
# Open pipe for anything else so Popen works on python2.4.
suberr = subprocess.PIPE
p = subprocess.Popen(command,
shell=(sys.platform == 'win32'),
stdout=subout,
stderr=suberr)
p.wait()
if stdout is None:
self.stdout = p.stdout.read()
elif stdout is not sys.stdout:
stdout.write(p.stdout.read())
if stderr not in (None, sys.stderr):
stderr.write(p.stderr.read())
return p.returncode
def run(self, command, display=None, stdout=None, stderr=None):
"""
Runs a single command, displaying it first.
"""
if display is None:
display = command
self.display(display)
return self.execute(command, stdout, stderr)
class Unbuffered(object):
def __init__(self, fp):
self.fp = fp
def write(self, arg):
self.fp.write(arg)
self.fp.flush()
def __getattr__(self, attr):
return getattr(self.fp, attr)
sys.stdout = Unbuffered(sys.stdout)
sys.stderr = Unbuffered(sys.stderr)
def is_test_name(f):
return f.startswith('gyptest') and f.endswith('.py')
def find_all_gyptest_files(directory):
result = []
for root, dirs, files in os.walk(directory):
if '.svn' in dirs:
dirs.remove('.svn')
result.extend([ os.path.join(root, f) for f in files if is_test_name(f) ])
result.sort()
return result
def main(argv=None):
if argv is None:
argv = sys.argv
usage = "gyptest.py [-ahlnq] [-f formats] [test ...]"
parser = optparse.OptionParser(usage=usage)
parser.add_option("-a", "--all", action="store_true",
help="run all tests")
parser.add_option("-C", "--chdir", action="store", default=None,
help="chdir to the specified directory")
parser.add_option("-f", "--format", action="store", default='',
help="run tests with the specified formats")
parser.add_option("-G", '--gyp_option', action="append", default=[],
help="Add -G options to the gyp command line")
parser.add_option("-l", "--list", action="store_true",
help="list available tests and exit")
parser.add_option("-n", "--no-exec", action="store_true",
help="no execute, just print the command line")
parser.add_option("--passed", action="store_true",
help="report passed tests")
parser.add_option("--path", action="append", default=[],
help="additional $PATH directory")
parser.add_option("-q", "--quiet", action="store_true",
help="quiet, don't print test command lines")
opts, args = parser.parse_args(argv[1:])
if opts.chdir:
os.chdir(opts.chdir)
if opts.path:
extra_path = [os.path.abspath(p) for p in opts.path]
extra_path = os.pathsep.join(extra_path)
os.environ['PATH'] = extra_path + os.pathsep + os.environ['PATH']
if not args:
if not opts.all:
sys.stderr.write('Specify -a to get all tests.\n')
return 1
args = ['test']
tests = []
for arg in args:
if os.path.isdir(arg):
tests.extend(find_all_gyptest_files(os.path.normpath(arg)))
else:
if not is_test_name(os.path.basename(arg)):
print >>sys.stderr, arg, 'is not a valid gyp test name.'
sys.exit(1)
tests.append(arg)
if opts.list:
for test in tests:
print test
sys.exit(0)
CommandRunner.verbose = not opts.quiet
CommandRunner.active = not opts.no_exec
cr = CommandRunner()
os.environ['PYTHONPATH'] = os.path.abspath('test/lib')
if not opts.quiet:
sys.stdout.write('PYTHONPATH=%s\n' % os.environ['PYTHONPATH'])
passed = []
failed = []
no_result = []
if opts.format:
format_list = opts.format.split(',')
else:
# TODO: not duplicate this mapping from pylib/gyp/__init__.py
format_list = {
'aix5': ['make'],
'freebsd7': ['make'],
'freebsd8': ['make'],
'openbsd5': ['make'],
'cygwin': ['msvs'],
'win32': ['msvs', 'ninja'],
'linux2': ['make', 'ninja'],
'linux3': ['make', 'ninja'],
'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'],
}[sys.platform]
for format in format_list:
os.environ['TESTGYP_FORMAT'] = format
if not opts.quiet:
sys.stdout.write('TESTGYP_FORMAT=%s\n' % format)
gyp_options = []
for option in opts.gyp_option:
gyp_options += ['-G', option]
if gyp_options and not opts.quiet:
sys.stdout.write('Extra Gyp options: %s\n' % gyp_options)
for test in tests:
status = cr.run([sys.executable, test] + gyp_options,
stdout=sys.stdout,
stderr=sys.stderr)
if status == 2:
no_result.append(test)
elif status:
failed.append(test)
else:
passed.append(test)
if not opts.quiet:
def report(description, tests):
if tests:
if len(tests) == 1:
sys.stdout.write("\n%s the following test:\n" % description)
else:
fmt = "\n%s the following %d tests:\n"
sys.stdout.write(fmt % (description, len(tests)))
sys.stdout.write("\t" + "\n\t".join(tests) + "\n")
if opts.passed:
report("Passed", passed)
report("Failed", failed)
report("No result from", no_result)
if failed:
return 1
else:
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@ -13,16 +13,12 @@ import gyp
import glob
def JoinPath(*args):
return os.path.normpath(os.path.join(*args))
class VisualStudioVersion(object):
"""Information regarding a version of Visual Studio."""
def __init__(self, short_name, description,
solution_version, project_version, flat_sln, uses_vcxproj,
path, sdk_based, default_toolset=None, compatible_sdks=None):
path, sdk_based, default_toolset=None):
self.short_name = short_name
self.description = description
self.solution_version = solution_version
@ -32,9 +28,6 @@ class VisualStudioVersion(object):
self.path = path
self.sdk_based = sdk_based
self.default_toolset = default_toolset
compatible_sdks = compatible_sdks or []
compatible_sdks.sort(key=lambda v: float(v.replace('v', '')), reverse=True)
self.compatible_sdks = compatible_sdks
def ShortName(self):
return self.short_name
@ -75,59 +68,45 @@ class VisualStudioVersion(object):
of a user override."""
return self.default_toolset
def _SetupScriptInternal(self, target_arch):
"""Returns a command (with arguments) to be used to set up the
environment."""
assert target_arch in ('x86', 'x64'), "target_arch not supported"
# If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the
# depot_tools build tools and should run SetEnv.Cmd to set up the
# environment. The check for WindowsSDKDir alone is not sufficient because
# this is set by running vcvarsall.bat.
sdk_dir = os.environ.get('WindowsSDKDir', '')
setup_path = JoinPath(sdk_dir, 'Bin', 'SetEnv.Cmd')
assert target_arch in ('x86', 'x64')
sdk_dir = os.environ.get('WindowsSDKDir')
if sdk_dir:
setup_path = os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd'))
if self.sdk_based and sdk_dir and os.path.exists(setup_path):
return [setup_path, '/' + target_arch]
is_host_arch_x64 = (
os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'
)
# For VS2017 (and newer) it's fairly easy
if self.short_name >= '2017':
script_path = JoinPath(self.path,
'VC', 'Auxiliary', 'Build', 'vcvarsall.bat')
# Always use a native executable, cross-compiling if necessary.
host_arch = 'amd64' if is_host_arch_x64 else 'x86'
msvc_target_arch = 'amd64' if target_arch == 'x64' else 'x86'
arg = host_arch
if host_arch != msvc_target_arch:
arg += '_' + msvc_target_arch
return [script_path, arg]
# We try to find the best version of the env setup batch.
vcvarsall = JoinPath(self.path, 'VC', 'vcvarsall.bat')
if target_arch == 'x86':
if self.short_name >= '2013' and self.short_name[-1] != 'e' and \
is_host_arch_x64:
# VS2013 and later, non-Express have a x64-x86 cross that we want
# to prefer.
return [vcvarsall, 'amd64_x86']
else:
# We don't use VC/vcvarsall.bat for x86 because vcvarsall calls
# vcvars32, which it can only find if VS??COMNTOOLS is set, which it
# isn't always.
if target_arch == 'x86':
if self.short_name >= '2013' and self.short_name[-1] != 'e' and (
os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
# VS2013 and later, non-Express have a x64-x86 cross that we want
# to prefer.
return [os.path.normpath(
os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86']
# Otherwise, the standard x86 compiler.
return [os.path.normpath(
os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))]
else:
# Otherwise, the standard x86 compiler. We don't use VC/vcvarsall.bat
# for x86 because vcvarsall calls vcvars32, which it can only find if
# VS??COMNTOOLS is set, which isn't guaranteed.
return [JoinPath(self.path, 'Common7', 'Tools', 'vsvars32.bat')]
elif target_arch == 'x64':
arg = 'x86_amd64'
# Use the 64-on-64 compiler if we're not using an express edition and
# we're running on a 64bit OS.
if self.short_name[-1] != 'e' and is_host_arch_x64:
arg = 'amd64'
return [vcvarsall, arg]
assert target_arch == 'x64'
arg = 'x86_amd64'
# Use the 64-on-64 compiler if we're not using an express
# edition and we're running on a 64bit OS.
if self.short_name[-1] != 'e' and (
os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'):
arg = 'amd64'
return [os.path.normpath(
os.path.join(self.path, 'VC/vcvarsall.bat')), arg]
def SetupScript(self, target_arch):
script_data = self._SetupScriptInternal(target_arch)
@ -257,16 +236,6 @@ def _CreateVersion(name, path, sdk_based=False):
if path:
path = os.path.normpath(path)
versions = {
'2017': VisualStudioVersion('2017',
'Visual Studio 2017',
solution_version='12.00',
project_version='15.0',
flat_sln=False,
uses_vcxproj=True,
path=path,
sdk_based=sdk_based,
default_toolset='v141',
compatible_sdks=['v8.1', 'v10.0']),
'2015': VisualStudioVersion('2015',
'Visual Studio 2015',
solution_version='12.00',
@ -379,6 +348,7 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
A list of visual studio versions installed in descending order of
usage preference.
Base this on the registry and a quick check if devenv.exe exists.
Only versions 8-10 are considered.
Possibilities are:
2005(e) - Visual Studio 2005 (8)
2008(e) - Visual Studio 2008 (9)
@ -386,7 +356,6 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
2012(e) - Visual Studio 2012 (11)
2013(e) - Visual Studio 2013 (12)
2015 - Visual Studio 2015 (14)
2017 - Visual Studio 2017 (15)
Where (e) is e for express editions of MSVS and blank otherwise.
"""
version_to_year = {
@ -396,7 +365,6 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
'11.0': '2012',
'12.0': '2013',
'14.0': '2015',
'15.0': '2017'
}
versions = []
for version in versions_to_check:
@ -427,18 +395,13 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
# The old method above does not work when only SDK is installed.
keys = [r'HKLM\Software\Microsoft\VisualStudio\SxS\VC7',
r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7',
r'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7']
r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7']
for index in range(len(keys)):
path = _RegistryGetValue(keys[index], version)
if not path:
continue
path = _ConvertToCygpath(path)
if version == '15.0':
if os.path.exists(path):
versions.append(_CreateVersion('2017', path))
elif version != '14.0': # There is no Express edition for 2015.
if version != '14.0': # There is no Express edition for 2015.
versions.append(_CreateVersion(version_to_year[version] + 'e',
os.path.join(path, '..'), sdk_based=True))
@ -457,7 +420,7 @@ def SelectVisualStudioVersion(version='auto', allow_fallback=True):
if version == 'auto':
version = os.environ.get('GYP_MSVS_VERSION', 'auto')
version_map = {
'auto': ('15.0', '14.0', '12.0', '10.0', '9.0', '8.0', '11.0'),
'auto': ('14.0', '12.0', '10.0', '9.0', '8.0', '11.0'),
'2005': ('8.0',),
'2005e': ('8.0',),
'2008': ('9.0',),
@ -469,7 +432,6 @@ def SelectVisualStudioVersion(version='auto', allow_fallback=True):
'2013': ('12.0',),
'2013e': ('12.0',),
'2015': ('14.0',),
'2017': ('15.0',),
}
override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH')
if override_path:

View File

@ -46,10 +46,13 @@ def FindBuildFiles():
build_files.append(file)
return build_files
#TODO @@NG Find correct way to pass circular_check to Load
# Causes a pickle error in gyp.input.CircularException
# see http://stackoverflow.com/questions/4677012/python-cant-pickle-type-x-attribute-lookup-failed
# we'll live without the check - jesup
def Load(build_files, format, default_variables={},
includes=[], depth='.', params=None, check=False,
circular_check=True, duplicate_basename_check=True):
circular_check=False, duplicate_basename_check=True):
"""
Loads one or more specified build files.
default_variables and includes will be copied before use.
@ -70,6 +73,9 @@ def Load(build_files, format, default_variables={},
default_variables['GENERATOR'] = format
default_variables['GENERATOR_FLAVOR'] = params.get('flavor', '')
# Provide a PYTHON value to run sub-commands with the same python
default_variables['PYTHON'] = sys.executable
# Format can be a custom python file, or by default the name of a module
# within gyp.generator.
if format.endswith('.py'):

View File

@ -429,10 +429,6 @@ def GetFlavor(params):
return 'netbsd'
if sys.platform.startswith('aix'):
return 'aix'
if sys.platform.startswith('zos'):
return 'zos'
if sys.platform.startswith('os390'):
return 'zos'
return 'linux'

View File

@ -4,7 +4,6 @@
import re
import os
import locale
def XmlToString(content, encoding='utf-8', pretty=False):
@ -117,10 +116,6 @@ def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False,
if win32 and os.linesep != '\r\n':
xml_string = xml_string.replace('\n', '\r\n')
default_encoding = locale.getdefaultlocale()[1]
if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.decode(default_encoding).encode(encoding)
# Get the old content
try:
f = open(path, 'r')

View File

@ -31,8 +31,6 @@ import gyp.xcode_emulation
from gyp.common import GetEnvironFallback
from gyp.common import GypError
import hashlib
generator_default_variables = {
'EXECUTABLE_PREFIX': '',
'EXECUTABLE_SUFFIX': '',
@ -92,10 +90,7 @@ def CalculateVariables(default_variables, params):
if flavor == 'android':
operating_system = 'linux' # Keep this legacy behavior for now.
default_variables.setdefault('OS', operating_system)
if flavor == 'aix':
default_variables.setdefault('SHARED_LIB_SUFFIX', '.a')
else:
default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
default_variables.setdefault('SHARED_LIB_DIR','$(builddir)/lib.$(TOOLSET)')
default_variables.setdefault('LIB_DIR', '$(obj).$(TOOLSET)')
@ -232,24 +227,6 @@ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSE
"""
LINK_COMMANDS_OS390 = """\
quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL
"""
# Header of toplevel Makefile.
# This should go into the build tree, but it's easier to keep it here for now.
SHARED_HEADER = ("""\
@ -313,7 +290,7 @@ CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= %(CXX.host)s
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= %(LINK.host)s
LDFLAGS.host ?= $(LDFLAGS_host)
LDFLAGS.host ?=
AR.host ?= %(AR.host)s
# Define a dir function that can handle spaces.
@ -333,7 +310,7 @@ dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
# We write to a dep file on the side first and then rename at the end
# so we can't end up with a broken dep file.
depfile = $(depsdir)/$(call replace_spaces,$@).d
DEPFLAGS = %(makedep_args)s -MF $(depfile).raw
DEPFLAGS = -MMD -MF $(depfile).raw
# We have to fixup the deps output in a few ways.
# (1) the file output should mention the proper .o file.
@ -1370,10 +1347,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
if target[:3] == 'lib':
target = target[3:]
target_prefix = 'lib'
if self.flavor == 'aix':
target_ext = '.a'
else:
target_ext = '.so'
target_ext = '.so'
elif self.type == 'none':
target = '%s.stamp' % target
elif self.type != 'executable':
@ -1769,10 +1743,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
# actual command.
# - The intermediate recipe will 'touch' the intermediate file.
# - The multi-output rule will have an do-nothing recipe.
# Hash the target name to avoid generating overlong filenames.
cmddigest = hashlib.sha1(command if command else self.target).hexdigest()
intermediate = "%s.intermediate" % (cmddigest)
intermediate = "%s.intermediate" % (command if command else self.target)
self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))
self.WriteLn('\t%s' % '@:');
self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate))
@ -2040,7 +2011,6 @@ def GenerateOutput(target_list, target_dicts, data, params):
flock_command= 'flock'
copy_archive_arguments = '-af'
makedep_arguments = '-MMD'
header_params = {
'default_target': default_target,
'builddir': builddir_name,
@ -2051,7 +2021,6 @@ def GenerateOutput(target_list, target_dicts, data, params):
'extra_commands': '',
'srcdir': srcdir,
'copy_archive_args': copy_archive_arguments,
'makedep_args': makedep_arguments,
}
if flavor == 'mac':
flock_command = './gyp-mac-tool flock'
@ -2065,14 +2034,6 @@ def GenerateOutput(target_list, target_dicts, data, params):
header_params.update({
'link_commands': LINK_COMMANDS_ANDROID,
})
elif flavor == 'zos':
copy_archive_arguments = '-fPR'
makedep_arguments = '-qmakedep=gcc'
header_params.update({
'copy_archive_args': copy_archive_arguments,
'makedep_args': makedep_arguments,
'link_commands': LINK_COMMANDS_OS390,
})
elif flavor == 'solaris':
header_params.update({
'flock': './gyp-flock-tool flock',

View File

@ -294,31 +294,19 @@ def _ConfigFullName(config_name, config_data):
return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name)
def _ConfigWindowsTargetPlatformVersion(config_data, version):
config_ver = config_data.get('msvs_windows_sdk_version')
vers = [config_ver] if config_ver else version.compatible_sdks
for ver in vers:
for key in [
r'HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s',
r'HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s']:
sdk_dir = MSVSVersion._RegistryGetValue(key % ver, 'InstallationFolder')
if not sdk_dir:
continue
version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or ''
# Find a matching entry in sdk_dir\include.
expected_sdk_dir=r'%s\include' % sdk_dir
names = sorted([x for x in (os.listdir(expected_sdk_dir)
if os.path.isdir(expected_sdk_dir)
else []
)
if x.startswith(version)], reverse=True)
if names:
return names[0]
else:
print >> sys.stdout, (
'Warning: No include files found for '
'detected Windows SDK version %s' % (version)
)
def _ConfigWindowsTargetPlatformVersion(config_data):
ver = config_data.get('msvs_windows_sdk_version')
for key in [r'HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s',
r'HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s']:
sdk_dir = MSVSVersion._RegistryGetValue(key % ver, 'InstallationFolder')
if not sdk_dir:
continue
version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or ''
# Find a matching entry in sdk_dir\include.
names = sorted([x for x in os.listdir(r'%s\include' % sdk_dir)
if x.startswith(version)], reverse=True)
return names[0]
def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path,
@ -1727,17 +1715,14 @@ def _GetCopies(spec):
src_bare = src[:-1]
base_dir = posixpath.split(src_bare)[0]
outer_dir = posixpath.split(src_bare)[1]
fixed_dst = _FixPath(dst)
full_dst = '"%s\\%s\\"' % (fixed_dst, outer_dir)
cmd = 'mkdir %s 2>nul & cd "%s" && xcopy /e /f /y "%s" %s' % (
full_dst, _FixPath(base_dir), outer_dir, full_dst)
cmd = 'cd "%s" && xcopy /e /f /y "%s" "%s\\%s\\"' % (
_FixPath(base_dir), outer_dir, _FixPath(dst), outer_dir)
copies.append(([src], ['dummy_copies', dst], cmd,
'Copying %s to %s' % (src, fixed_dst)))
'Copying %s to %s' % (src, dst)))
else:
fix_dst = _FixPath(cpy['destination'])
cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % (
fix_dst, _FixPath(src), _FixPath(dst))
copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, fix_dst)))
_FixPath(cpy['destination']), _FixPath(src), _FixPath(dst))
copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, dst)))
return copies
@ -2679,7 +2664,7 @@ def _GetMSBuildProjectConfigurations(configurations):
return [group]
def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name):
namespace = os.path.splitext(gyp_file_name)[0]
properties = [
['PropertyGroup', {'Label': 'Globals'},
@ -2694,18 +2679,6 @@ def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64':
properties[0].append(['PreferredToolArchitecture', 'x64'])
if spec.get('msvs_target_platform_version'):
target_platform_version = spec.get('msvs_target_platform_version')
properties[0].append(['WindowsTargetPlatformVersion',
target_platform_version])
if spec.get('msvs_target_platform_minversion'):
target_platform_minversion = spec.get('msvs_target_platform_minversion')
properties[0].append(['WindowsTargetPlatformMinVersion',
target_platform_minversion])
else:
properties[0].append(['WindowsTargetPlatformMinVersion',
target_platform_version])
if spec.get('msvs_enable_winrt'):
properties[0].append(['DefaultLanguage', 'en-US'])
properties[0].append(['AppContainerApplication', 'true'])
@ -2714,6 +2687,18 @@ def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
properties[0].append(['ApplicationTypeRevision', app_type_revision])
else:
properties[0].append(['ApplicationTypeRevision', '8.1'])
if spec.get('msvs_target_platform_version'):
target_platform_version = spec.get('msvs_target_platform_version')
properties[0].append(['WindowsTargetPlatformVersion',
target_platform_version])
if spec.get('msvs_target_platform_minversion'):
target_platform_minversion = spec.get('msvs_target_platform_minversion')
properties[0].append(['WindowsTargetPlatformMinVersion',
target_platform_minversion])
else:
properties[0].append(['WindowsTargetPlatformMinVersion',
target_platform_version])
if spec.get('msvs_enable_winphone'):
properties[0].append(['ApplicationType', 'Windows Phone'])
else:
@ -2724,18 +2709,15 @@ def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
for configuration in spec['configurations'].itervalues():
platform_name = platform_name or _ConfigPlatform(configuration)
msvs_windows_sdk_version = (msvs_windows_sdk_version or
_ConfigWindowsTargetPlatformVersion(configuration, version))
_ConfigWindowsTargetPlatformVersion(configuration))
if platform_name and msvs_windows_sdk_version:
break
if msvs_windows_sdk_version:
properties[0].append(['WindowsTargetPlatformVersion',
str(msvs_windows_sdk_version)])
elif version.compatible_sdks:
raise GypError('%s requires any SDK of %s version, but none were found' %
(version.description, version.compatible_sdks))
if platform_name == 'ARM':
properties[0].append(['WindowsSDKDesktopARMSupport', 'true'])
if msvs_windows_sdk_version:
properties[0].append(['WindowsTargetPlatformVersion',
str(msvs_windows_sdk_version)])
return properties
@ -2880,9 +2862,6 @@ def _GetMSBuildAttributes(spec, config, build_file):
product_name = spec.get('product_name', '$(ProjectName)')
target_name = prefix + product_name
msbuild_attributes['TargetName'] = target_name
if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec:
ext = spec.get('product_extension')
msbuild_attributes['TargetExt'] = '.' + ext
if spec.get('msvs_external_builder'):
external_out_dir = spec.get('msvs_external_builder_out_dir', '.')
@ -2937,9 +2916,6 @@ def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file):
attributes['OutputDirectory'])
_AddConditionalProperty(properties, condition, 'TargetName',
attributes['TargetName'])
if 'TargetExt' in attributes:
_AddConditionalProperty(properties, condition, 'TargetExt',
attributes['TargetExt'])
if attributes.get('TargetPath'):
_AddConditionalProperty(properties, condition, 'TargetPath',
@ -3292,9 +3268,6 @@ def _GetMSBuildProjectReferences(project):
['ReferenceOutputAssembly', 'false']
]
for config in dependency.spec.get('configurations', {}).itervalues():
if config.get('msvs_use_library_dependency_inputs', 0):
project_ref.append(['UseLibraryDependencyInputs', 'true'])
break
# If it's disabled in any config, turn it off in the reference.
if config.get('msvs_2010_disable_uldi_when_referenced', 0):
project_ref.append(['UseLibraryDependencyInputs', 'false'])
@ -3387,8 +3360,7 @@ def _GenerateMSBuildProject(project, options, version, generator_flags):
}]
content += _GetMSBuildProjectConfigurations(configurations)
content += _GetMSBuildGlobalProperties(spec, version, project.guid,
project_file_name)
content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name)
content += import_default_section
content += _GetMSBuildConfigurationDetails(spec, project.build_file)
if spec.get('msvs_enable_winphone'):

View File

@ -1195,10 +1195,7 @@ class NinjaWriter(object):
is_executable = spec['type'] == 'executable'
# The ldflags config key is not used on mac or win. On those platforms
# linker flags are set via xcode_settings and msvs_settings, respectively.
if self.toolset == 'target':
env_ldflags = os.environ.get('LDFLAGS', '').split()
elif self.toolset == 'host':
env_ldflags = os.environ.get('LDFLAGS_host', '').split()
env_ldflags = os.environ.get('LDFLAGS', '').split()
if self.flavor == 'mac':
ldflags = self.xcode_settings.GetLdflags(config_name,
self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']),
@ -2314,22 +2311,15 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
'stamp',
description='STAMP $out',
command='%s gyp-win-tool stamp $out' % sys.executable)
master_ninja.rule(
'copy',
description='COPY $in $out',
command='%s gyp-win-tool recursive-mirror $in $out' % sys.executable)
else:
master_ninja.rule(
'stamp',
description='STAMP $out',
command='${postbuilds}touch $out')
if flavor == 'win':
master_ninja.rule(
'copy',
description='COPY $in $out',
command='%s gyp-win-tool recursive-mirror $in $out' % sys.executable)
elif flavor == 'zos':
master_ninja.rule(
'copy',
description='COPY $in $out',
command='rm -rf $out && cp -fRP $in $out')
else:
master_ninja.rule(
'copy',
description='COPY $in $out',

View File

@ -105,21 +105,17 @@ class MacTool(object):
ibtool_section_re = re.compile(r'/\*.*\*/')
ibtool_re = re.compile(r'.*note:.*is clipping its content')
try:
stdout = subprocess.check_output(args)
except subprocess.CalledProcessError as e:
print(e.output)
raise
ibtoolout = subprocess.Popen(args, stdout=subprocess.PIPE)
current_section_header = None
for line in stdout.splitlines():
for line in ibtoolout.stdout:
if ibtool_section_re.match(line):
current_section_header = line
elif not ibtool_re.match(line):
if current_section_header:
print(current_section_header)
sys.stdout.write(current_section_header)
current_section_header = None
print(line)
return 0
sys.stdout.write(line)
return ibtoolout.returncode
def _ConvertToBinary(self, dest):
subprocess.check_call([
@ -151,7 +147,7 @@ class MacTool(object):
fp = open(file_name, 'rb')
try:
header = fp.read(3)
except:
except e:
fp.close()
return None
fp.close()

View File

@ -30,10 +30,6 @@ def QuoteForRspFile(arg):
# works more or less because most programs (including the compiler, etc.)
# use that function to handle command line arguments.
# Use a heuristic to try to find args that are paths, and normalize them
if arg.find('/') > 0 or arg.count('/') > 1:
arg = os.path.normpath(arg)
# For a literal quote, CommandLineToArgvW requires 2n+1 backslashes
# preceding it, and results in n backslashes + the quote. So we substitute
# in 2* what we match, +1 more, plus the quote.
@ -273,8 +269,7 @@ class MsvsSettings(object):
def AdjustLibraries(self, libraries):
"""Strip -l from library if it's specified with that."""
libs = [lib[2:] if lib.startswith('-l') else lib for lib in libraries]
return [lib + '.lib' if not lib.lower().endswith('.lib') else lib
for lib in libs]
return [lib + '.lib' if not lib.endswith('.lib') else lib for lib in libs]
def _GetAndMunge(self, field, path, default, prefix, append, map):
"""Retrieve a value from |field| at |path| or return |default|. If
@ -311,10 +306,7 @@ class MsvsSettings(object):
# There's two levels of architecture/platform specification in VS. The
# first level is globally for the configuration (this is what we consider
# "the" config at the gyp level, which will be something like 'Debug' or
# 'Release'), VS2015 and later only use this level
if self.vs_version.short_name >= 2015:
return config
# and a second target-specific configuration, which is an
# 'Release_x64'), and a second target-specific configuration, which is an
# override for the global one. |config| is remapped here to take into
# account the local target-specific overrides to the global configuration.
arch = self.GetArch(config)
@ -476,10 +468,8 @@ class MsvsSettings(object):
prefix='/arch:')
cflags.extend(['/FI' + f for f in self._Setting(
('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])])
if self.vs_version.project_version >= 12.0:
# New flag introduced in VS2013 (project version 12.0) Forces writes to
# the program database (PDB) to be serialized through MSPDBSRV.EXE.
# https://msdn.microsoft.com/en-us/library/dn502518.aspx
if self.vs_version.short_name in ('2013', '2013e', '2015'):
# New flag required in 2013 to maintain previous PDB behavior.
cflags.append('/FS')
# ninja handles parallelism by itself, don't have the compiler do it too.
cflags = filter(lambda x: not x.startswith('/MP'), cflags)
@ -539,8 +529,7 @@ class MsvsSettings(object):
"""Returns the .def file from sources, if any. Otherwise returns None."""
spec = self.spec
if spec['type'] in ('shared_library', 'loadable_module', 'executable'):
def_files = [s for s in spec.get('sources', [])
if s.lower().endswith('.def')]
def_files = [s for s in spec.get('sources', []) if s.endswith('.def')]
if len(def_files) == 1:
return gyp_to_build_path(def_files[0])
elif len(def_files) > 1:

Some files were not shown because too many files have changed in this diff Show More