Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: build/common.gypi

Issue 8983002: Allow targets to self-select optimization level in official builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge resolution issue. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | build/internal/release_defaults.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # IMPORTANT: 5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium, 6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion. 7 # since gyp_chromium is automatically forcing its inclusion.
8 { 8 {
9 # Variables expected to be overriden on the GYP command line (-D) or by 9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi. 10 # ~/.gyp/include.gypi.
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 # Enable Keystone auto-update support. 748 # Enable Keystone auto-update support.
749 'mac_keystone%': 1, 749 'mac_keystone%': 1,
750 }, { # else: branding!="Chrome" or buildtype!="Official" 750 }, { # else: branding!="Chrome" or buildtype!="Official"
751 'mac_breakpad_uploads%': 0, 751 'mac_breakpad_uploads%': 0,
752 'mac_breakpad%': 0, 752 'mac_breakpad%': 0,
753 'mac_keystone%': 0, 753 'mac_keystone%': 0,
754 }], 754 }],
755 ], 755 ],
756 }], # OS=="mac" 756 }], # OS=="mac"
757 757
758 # Whether to use multiple cores to compile with visual studio. This is
759 # optional because it sometimes causes corruption on VS 2005.
760 # It is on by default on VS 2008 and off on VS 2005.
761 ['OS=="win"', { 758 ['OS=="win"', {
762 'conditions': [ 759 'conditions': [
763 ['component=="shared_library"', { 760 ['component=="shared_library"', {
764 'win_use_allocator_shim%': 0, 761 'win_use_allocator_shim%': 0,
765 }], 762 }],
763 # Whether to use multiple cores to compile with visual studio. This is
764 # optional because it sometimes causes corruption on VS 2005.
765 # It is on by default on VS 2008 and off on VS 2005.
766 ['MSVS_VERSION=="2005"', { 766 ['MSVS_VERSION=="2005"', {
767 'msvs_multi_core_compile%': 0, 767 'msvs_multi_core_compile%': 0,
768 },{ 768 },{
769 'msvs_multi_core_compile%': 1, 769 'msvs_multi_core_compile%': 1,
770 }], 770 }],
771 # Don't do incremental linking for large modules on 32-bit. 771 # Don't do incremental linking for large modules on 32-bit.
772 ['MSVS_OS_BITS==32', { 772 ['MSVS_OS_BITS==32', {
773 'msvs_large_module_debug_link_mode%': '1', # No 773 'msvs_large_module_debug_link_mode%': '1', # No
774 },{ 774 },{
775 'msvs_large_module_debug_link_mode%': '2', # Yes 775 'msvs_large_module_debug_link_mode%': '2', # Yes
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 'defines': [ 1502 'defines': [
1503 'NDEBUG', 1503 'NDEBUG',
1504 ], 1504 ],
1505 'xcode_settings': { 1505 'xcode_settings': {
1506 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip 1506 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
1507 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', 1507 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
1508 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ], 1508 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
1509 }, 1509 },
1510 'msvs_settings': { 1510 'msvs_settings': {
1511 'VCCLCompilerTool': { 1511 'VCCLCompilerTool': {
1512 'Optimization': '<(win_release_Optimization)',
1513 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', 1512 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
1514 'conditions': [ 1513 'conditions': [
1514 # In official builds, each target will self-select
1515 # an optimization level.
1516 ['buildtype!="Official"', {
1517 'Optimization': '<(win_release_Optimization)',
1518 },
1519 ],
1515 # According to MSVS, InlineFunctionExpansion=0 means 1520 # According to MSVS, InlineFunctionExpansion=0 means
1516 # "default inlining", not "/Ob0". 1521 # "default inlining", not "/Ob0".
1517 # Thus, we have to handle InlineFunctionExpansion==0 separately. 1522 # Thus, we have to handle InlineFunctionExpansion==0 separately.
1518 ['win_release_InlineFunctionExpansion==0', { 1523 ['win_release_InlineFunctionExpansion==0', {
1519 'AdditionalOptions': ['/Ob0'], 1524 'AdditionalOptions': ['/Ob0'],
1520 }], 1525 }],
1521 ['win_release_InlineFunctionExpansion!=""', { 1526 ['win_release_InlineFunctionExpansion!=""', {
1522 'InlineFunctionExpansion': 1527 'InlineFunctionExpansion':
1523 '<(win_release_InlineFunctionExpansion)', 1528 '<(win_release_InlineFunctionExpansion)',
1524 }], 1529 }],
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 }], 2339 }],
2335 ['asan==1', { 2340 ['asan==1', {
2336 'xcode_settings': { 2341 'xcode_settings': {
2337 'OTHER_CFLAGS': [ 2342 'OTHER_CFLAGS': [
2338 '-faddress-sanitizer', 2343 '-faddress-sanitizer',
2339 '-w', 2344 '-w',
2340 ], 2345 ],
2341 'OTHER_LDFLAGS': [ 2346 'OTHER_LDFLAGS': [
2342 '-faddress-sanitizer', 2347 '-faddress-sanitizer',
2343 # The symbols below are referenced in the ASan runtime 2348 # The symbols below are referenced in the ASan runtime
2344 # library (compiled on OS X 10.6), but may be unavailable 2349 # library (compiled on OS X 10.6), but may be unavailable
2345 # on the prior OS X versions. Because Chromium is currently 2350 # on the prior OS X versions. Because Chromium is currently
2346 # targeting 10.5.0, we need to explicitly mark these 2351 # targeting 10.5.0, we need to explicitly mark these
2347 # symbols as dynamic_lookup. 2352 # symbols as dynamic_lookup.
2348 '-Wl,-U,_malloc_default_purgeable_zone', 2353 '-Wl,-U,_malloc_default_purgeable_zone',
2349 '-Wl,-U,_malloc_zone_memalign', 2354 '-Wl,-U,_malloc_zone_memalign',
2350 '-Wl,-U,_dispatch_sync_f', 2355 '-Wl,-U,_dispatch_sync_f',
2351 '-Wl,-U,_dispatch_async_f', 2356 '-Wl,-U,_dispatch_async_f',
2352 '-Wl,-U,_dispatch_barrier_async_f', 2357 '-Wl,-U,_dispatch_barrier_async_f',
2353 '-Wl,-U,_dispatch_group_async_f', 2358 '-Wl,-U,_dispatch_group_async_f',
2354 '-Wl,-U,_dispatch_after_f', 2359 '-Wl,-U,_dispatch_after_f',
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 '_WINDOWS', 2491 '_WINDOWS',
2487 'NOMINMAX', 2492 'NOMINMAX',
2488 'PSAPI_VERSION=1', 2493 'PSAPI_VERSION=1',
2489 '_CRT_RAND_S', 2494 '_CRT_RAND_S',
2490 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', 2495 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
2491 'WIN32_LEAN_AND_MEAN', 2496 'WIN32_LEAN_AND_MEAN',
2492 '_ATL_NO_OPENGL', 2497 '_ATL_NO_OPENGL',
2493 '_HAS_TR1=0', 2498 '_HAS_TR1=0',
2494 ], 2499 ],
2495 'conditions': [ 2500 'conditions': [
2501 ['buildtype=="Official"', {
2502 # In official builds, targets can self-select an optimization
2503 # level by defining a variable named 'optimize', and setting it
2504 # to one of
2505 # - "size", optimizes for minimal code size - the default.
2506 # - "speed", optimizes for speed over code size.
2507 # - "max", whole program optimization and link-time code
2508 # generation. This is very expensive and should be used
2509 # sparingly.
2510 'variables': {
2511 'optimize%': 'size',
Nico 2011/12/20 20:03:09 Probably too late, but: Should this be called win_
2512 },
2513 'target_conditions': [
2514 ['optimize=="size"', {
2515 'msvs_settings': {
2516 'VCCLCompilerTool': {
2517 # 1, optimizeMinSpace, Minimize Size (/O1)
2518 'Optimization': '1',
2519 # 2, favorSize - Favor small code (/Os)
2520 'FavorSizeOrSpeed': '2',
2521 },
2522 },
2523 },
2524 ],
2525 ['optimize=="speed"', {
2526 'msvs_settings': {
2527 'VCCLCompilerTool': {
2528 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
2529 'Optimization': '2',
2530 # 1, favorSpeed - Favor fast code (/Ot)
2531 'FavorSizeOrSpeed': '1',
2532 },
2533 },
2534 },
2535 ],
2536 ['optimize=="max"', {
2537 'msvs_settings': {
2538 'VCCLCompilerTool': {
2539 # 2, optimizeMaxSpeed, Maximize Speed (/O2)
2540 'Optimization': '2',
2541 # 1, favorSpeed - Favor fast code (/Ot)
2542 'FavorSizeOrSpeed': '1',
2543 # This implies link time code generation.
2544 'WholeProgramOptimization': 'true',
2545 },
2546 },
2547 },
2548 ],
2549 ],
2550 },
2551 ],
2496 ['component=="static_library"', { 2552 ['component=="static_library"', {
2497 'defines': [ 2553 'defines': [
2498 '_HAS_EXCEPTIONS=0', 2554 '_HAS_EXCEPTIONS=0',
2499 ], 2555 ],
2500 }], 2556 }],
2501 ['secure_atl', { 2557 ['secure_atl', {
2502 'defines': [ 2558 'defines': [
2503 '_SECURE_ATL', 2559 '_SECURE_ATL',
2504 ], 2560 ],
2505 }], 2561 }],
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2699 # settings in target dicts. SYMROOT is a special case, because many other 2755 # settings in target dicts. SYMROOT is a special case, because many other
2700 # Xcode variables depend on it, including variables such as 2756 # Xcode variables depend on it, including variables such as
2701 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 2757 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
2702 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 2758 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
2703 # files to appear (when present) in the UI as actual files and not red 2759 # files to appear (when present) in the UI as actual files and not red
2704 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 2760 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
2705 # and therefore SYMROOT, needs to be set at the project level. 2761 # and therefore SYMROOT, needs to be set at the project level.
2706 'SYMROOT': '<(DEPTH)/xcodebuild', 2762 'SYMROOT': '<(DEPTH)/xcodebuild',
2707 }, 2763 },
2708 } 2764 }
OLDNEW
« no previous file with comments | « no previous file | build/internal/release_defaults.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698