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

Side by Side Diff: chrome/chrome_dll.gypi

Issue 187813008: Add PGO targets to Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: It almost works ! Created 6 years, 9 months 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 'conditions': [ 5 'conditions': [
6 ['OS=="mac" or OS=="win"', { 6 ['OS=="mac" or OS=="win"', {
7 'targets': [ 7 'targets': [
8 { 8 {
9 'target_name': 'chrome_dll', 9 'target_name': '<(chrome_dll_target_name)',
10 'type': 'none', 10 'type': 'none',
11 'dependencies': [ 11 'dependencies': [
12 'chrome_main_dll', 12 '<(chrome_main_dll_target_name)',
13 ], 13 ],
14 'conditions': [ 14 'conditions': [
15 ['OS=="mac" and component=="shared_library"', { 15 ['OS=="mac" and component=="shared_library"', {
16 'type': 'shared_library', 16 'type': 'shared_library',
17 'includes': [ 'chrome_dll_bundle.gypi' ], 17 'includes': [ 'chrome_dll_bundle.gypi' ],
18 'xcode_settings': { 18 'xcode_settings': {
19 'OTHER_LDFLAGS': [ 19 'OTHER_LDFLAGS': [
20 '-Wl,-reexport_library,<(PRODUCT_DIR)/libchrome_main_dll.dylib ', 20 '-Wl,-reexport_library,<(PRODUCT_DIR)/libchrome_main_dll.dylib ',
21 ], 21 ],
22 }, 22 },
23 }], # OS=="mac" 23 }], # OS=="mac"
24 ['chrome_multiple_dll==1', { 24 ['chrome_multiple_dll==1', {
25 'dependencies': [ 25 'dependencies': [
26 'chrome_child_dll', 26 '<(chrome_child_dll_target_name)',
27 ], 27 ],
28 }], 28 }],
29 ['incremental_chrome_dll==1', { 29 ['incremental_chrome_dll==1', {
30 # Linking to a different directory and then hardlinking back 30 # Linking to a different directory and then hardlinking back
31 # to OutDir is a workaround to avoid having the .ilk for 31 # to OutDir is a workaround to avoid having the .ilk for
32 # chrome.exe and chrome.dll conflicting. See crbug.com/92528 32 # chrome.exe and chrome.dll conflicting. See crbug.com/92528
33 # for more information. Done on the dll instead of the exe so 33 # for more information. Done on the dll instead of the exe so
34 # that people launching from VS don't need to modify 34 # that people launching from VS don't need to modify
35 # $(TargetPath) for the exe. 35 # $(TargetPath) for the exe.
36 'actions': [ 36 'actions': [
37 { 37 {
38 'action_name': 'hardlink_to_output', 38 'action_name': 'hardlink_to_output',
39 'inputs': [ 39 'inputs': [
40 '$(OutDir)\\initial\\chrome.dll', 40 '$(OutDir)\\initial\\<(chrome_main_dll_product_name).dll',
41 ], 41 ],
42 'outputs': [ 42 'outputs': [
43 '$(OutDir)\\chrome.dll', 43 '$(OutDir)\\<(chrome_main_dll_product_name).dll',
44 ], 44 ],
45 'action': ['tools\\build\\win\\hardlink_failsafe.bat', 45 'action': ['tools\\build\\win\\hardlink_failsafe.bat',
46 '$(OutDir)\\initial\\chrome.dll', 46 '$(OutDir)\\initial\\<(chrome_main_dll_product_name ).dll',
47 '$(OutDir)\\chrome.dll'], 47 '$(OutDir)\\<(chrome_main_dll_product_name).dll'],
48 }, 48 },
49 ], 49 ],
50 'conditions': [ 50 'conditions': [
51 # Only hardlink pdb if we're generating debug info. 51 # Only hardlink pdb if we're generating debug info.
52 ['fastbuild==0 or win_z7!=0', { 52 ['fastbuild==0 or win_z7!=0', {
53 'actions': [ 53 'actions': [
54 { 54 {
55 'action_name': 'hardlink_pdb_to_output', 55 'action_name': 'hardlink_pdb_to_output',
56 'inputs': [ 56 'inputs': [
57 # Not the pdb, since gyp doesn't know about it 57 # Not the pdb, since gyp doesn't know about it
58 '$(OutDir)\\initial\\chrome.dll', 58 '$(OutDir)\\initial\\<(chrome_main_dll_product_name).dll ',
59 ], 59 ],
60 'outputs': [ 60 'outputs': [
61 '$(OutDir)\\chrome.dll.pdb', 61 '$(OutDir)\\<(chrome_main_dll_product_name).dll.pdb',
62 ], 62 ],
63 'action': ['tools\\build\\win\\hardlink_failsafe.bat', 63 'action': ['tools\\build\\win\\hardlink_failsafe.bat',
64 '$(OutDir)\\initial\\chrome.dll.pdb', 64 '$(OutDir)\\initial\\<(chrome_main_dll_product_ name).pdb',
65 '$(OutDir)\\chrome.dll.pdb'], 65 '$(OutDir)\\<(chrome_main_dll_product_name).pdb '],
66 } 66 }
67 ] 67 ]
68 }] 68 }]
69 ], 69 ],
70 }], 70 }],
71 ] 71 ]
72 }, 72 },
73 { 73 {
74 'target_name': 'chrome_main_dll', 74 'target_name': '<(chrome_main_dll_target_name)',
75 'type': 'shared_library', 75 'type': 'shared_library',
76 'variables': { 76 'variables': {
77 'enable_wexit_time_destructors': 1, 77 'enable_wexit_time_destructors': 1,
78 }, 78 },
79 'dependencies': [ 79 'dependencies': [
80 '<@(chromium_browser_dependencies)', 80 '<@(chromium_browser_dependencies)',
81 '../components/components.gyp:policy', 81 '../components/components.gyp:policy',
82 '../content/content.gyp:content_app_browser', 82 '../content/content.gyp:content_app_browser',
83 ], 83 ],
84 'conditions': [ 84 'conditions': [
85 ['OS=="win"', { 85 ['OS=="win"', {
86 'dependencies': [ 86 'dependencies': [
87 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf', 87 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
88 ], 88 ],
89 }], 89 }],
90 # This ugly hack is required to make sure that the instrumented DLL
91 # gets linked before trying to link the optimized one.
92 # ltcg_value==3 corresponds to the /LTCG:PGOPTIMIZE option.
93 # TODO(sebmarchand): Find a cleaner way to express this dependency.
94 ['OS=="win" and chrome_pgo==1 and ltcg_value==3', {
95 'dependencies': [
96 'chrome_pgo_profile',
97 ],
98 }],
90 ['use_aura==1', { 99 ['use_aura==1', {
91 'dependencies': [ 100 'dependencies': [
92 '../ui/compositor/compositor.gyp:compositor', 101 '../ui/compositor/compositor.gyp:compositor',
93 ], 102 ],
94 }], 103 }],
95 ['OS=="win" and target_arch=="ia32"', { 104 ['OS=="win" and target_arch=="ia32"', {
96 # Add a dependency to custom import library for user32 delay 105 # Add a dependency to custom import library for user32 delay
97 # imports only in x86 builds. 106 # imports only in x86 builds.
98 'dependencies': [ 107 'dependencies': [
99 'chrome_user32_delay_imports', 108 'chrome_user32_delay_imports',
100 ], 109 ],
101 },], 110 },],
102 ['OS=="win"', { 111 ['OS=="win"', {
103 'product_name': 'chrome', 112 'product_name': '<(chrome_main_dll_product_name)',
104 'dependencies': [ 113 'dependencies': [
105 # On Windows, link the dependencies (libraries) that make 114 # On Windows, link the dependencies (libraries) that make
106 # up actual Chromium functionality into this .dll. 115 # up actual Chromium functionality into this .dll.
107 'chrome_version_resources', 116 'chrome_version_resources',
108 '../chrome/chrome_resources.gyp:chrome_unscaled_resources', 117 '../chrome/chrome_resources.gyp:chrome_unscaled_resources',
109 '../crypto/crypto.gyp:crypto', 118 '../crypto/crypto.gyp:crypto',
110 '../net/net.gyp:net_resources', 119 '../net/net.gyp:net_resources',
111 '../ui/views/views.gyp:views', 120 '../ui/views/views.gyp:views',
112 '../webkit/webkit_resources.gyp:webkit_resources', 121 '../webkit/webkit_resources.gyp:webkit_resources',
113 ], 122 ],
(...skipping 26 matching lines...) Expand all
140 }, 149 },
141 }, 150 },
142 'msvs_settings': { 151 'msvs_settings': {
143 'VCLinkerTool': { 152 'VCLinkerTool': {
144 'BaseAddress': '0x01c30000', 153 'BaseAddress': '0x01c30000',
145 'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib', 154 'ImportLibrary': '$(OutDir)\\lib\\chrome_dll.lib',
146 # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency). 155 # Set /SUBSYSTEM:WINDOWS for chrome.dll (for consistency).
147 'SubSystem': '2', 156 'SubSystem': '2',
148 'conditions': [ 157 'conditions': [
149 ['incremental_chrome_dll==1', { 158 ['incremental_chrome_dll==1', {
150 'OutputFile': '$(OutDir)\\initial\\chrome.dll', 159 'OutputFile': '$(OutDir)\\initial\\<(chrome_main_dll_produ ct_name)',
151 'UseLibraryDependencyInputs': "true", 160 'UseLibraryDependencyInputs': "true",
152 }], 161 }],
153 ['target_arch=="ia32"', { 162 ['target_arch=="ia32"', {
154 # Link against the XP-constrained user32 import library 163 # Link against the XP-constrained user32 import library
155 # instead of the platform-SDK provided one to avoid 164 # instead of the platform-SDK provided one to avoid
156 # inadvertently taking dependencies on post-XP user32 165 # inadvertently taking dependencies on post-XP user32
157 # exports. 166 # exports.
158 'AdditionalDependencies!': [ 167 'AdditionalDependencies!': [
159 'user32.lib', 168 'user32.lib',
160 ], 169 ],
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 ['enable_printing!=0', { 222 ['enable_printing!=0', {
214 'dependencies': [ 223 'dependencies': [
215 '../printing/printing.gyp:printing', 224 '../printing/printing.gyp:printing',
216 ], 225 ],
217 }], 226 }],
218 ['component!="shared_library"', { # http://crbug.com/339215 227 ['component!="shared_library"', { # http://crbug.com/339215
219 'dependencies': [ 228 'dependencies': [
220 'chrome_dll_pdb_workaround', 229 'chrome_dll_pdb_workaround',
221 ], 230 ],
222 }], 231 }],
232 ['chrome_pgo==1', {
233 'msvs_settings': {
234 'VCLinkerTool': {
235 'LinkTimeCodeGeneration': '<(ltcg_value)',
236 'ProfileGuidedDatabase': '$(OutDir)\\chrome.pgd',
237 },
238 },
239 }],
223 ] 240 ]
224 }], 241 }],
225 ['chrome_multiple_dll==1', { 242 ['chrome_multiple_dll==1', {
226 'defines': [ 243 'defines': [
227 'CHROME_MULTIPLE_DLL_BROWSER', 244 'CHROME_MULTIPLE_DLL_BROWSER',
228 ], 245 ],
229 }, { 246 }, {
230 'dependencies': [ 247 'dependencies': [
231 '<@(chromium_child_dependencies)', 248 '<@(chromium_child_dependencies)',
232 '../content/content.gyp:content_app_both', 249 '../content/content.gyp:content_app_both',
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 ], 322 ],
306 }], # mac_breakpad_compiled_in 323 }], # mac_breakpad_compiled_in
307 ['internal_pdf', { 324 ['internal_pdf', {
308 'dependencies': [ 325 'dependencies': [
309 '../pdf/pdf.gyp:pdf', 326 '../pdf/pdf.gyp:pdf',
310 ], 327 ],
311 }], 328 }],
312 ], # conditions 329 ], # conditions
313 }], # OS=="mac" 330 }], # OS=="mac"
314 ], # conditions 331 ], # conditions
315 }, # target chrome_main_dll 332 }, # target <(chrome_main_dll_target_name)
316 ], # targets 333 ], # targets
317 }], # OS=="mac" or OS=="win" 334 }], # OS=="mac" or OS=="win"
318 ['OS=="win"', { 335 ['OS=="win"', {
319 'targets': [ 336 'targets': [
320 { 337 {
321 # This target is only depended upon on Windows. 338 # This target is only depended upon on Windows.
322 'target_name': 'chrome_dll_pdb_workaround', 339 'target_name': '<(chrome_dll_target_name)_pdb_workaround',
323 'type': 'static_library', 340 'type': 'static_library',
324 'sources': [ 'empty_pdb_workaround.cc' ], 341 'sources': [ 'empty_pdb_workaround.cc' ],
325 'conditions': [ 342 'conditions': [
326 ['fastbuild==0 or win_z7!=0', { 343 ['fastbuild==0 or win_z7!=0', {
327 'msvs_settings': { 344 'msvs_settings': {
328 'VCCLCompilerTool': { 345 'VCCLCompilerTool': {
329 # This *in the compile phase* must match the pdb name that's 346 # This *in the compile phase* must match the pdb name that's
330 # output by the final link. See empty_pdb_workaround.cc for 347 # output by the final link. See empty_pdb_workaround.cc for
331 # more details. 348 # more details.
332 'DebugInformationFormat': '3', 349 'DebugInformationFormat': '3',
333 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb', 350 'ProgramDataBaseFileName':
351 '<(PRODUCT_DIR)/<(chrome_main_dll_product_name).dll.pdb',
334 }, 352 },
335 }, 353 },
336 }], 354 }],
337 ], 355 ],
338 }, 356 },
339 ], 357 ],
340 }], 358 }],
341 ['chrome_multiple_dll', { 359 ['chrome_multiple_dll', {
342 'targets': [ 360 'targets': [
343 { 361 {
344 'target_name': 'chrome_child_dll', 362 'target_name': '<(chrome_child_dll_target_name)',
345 'type': 'shared_library', 363 'type': 'shared_library',
346 'product_name': 'chrome_child', 364 'product_name': '<(chrome_child_dll_product_name)',
347 'variables': { 365 'variables': {
348 'enable_wexit_time_destructors': 1, 366 'enable_wexit_time_destructors': 1,
349 }, 367 },
350 'dependencies': [ 368 'dependencies': [
351 '<@(chromium_child_dependencies)', 369 '<@(chromium_child_dependencies)',
352 '../content/content.gyp:content_app_child', 370 '../content/content.gyp:content_app_child',
353 '../content/content.gyp:content_worker', 371 '../content/content.gyp:content_worker',
354 'chrome_version_resources', 372 'chrome_version_resources',
355 'policy_path_parser', 373 'policy_path_parser',
356 ], 374 ],
357 'defines': [ 375 'defines': [
358 'CHROME_MULTIPLE_DLL_CHILD', 376 'CHROME_MULTIPLE_DLL_CHILD',
359 ], 377 ],
360 'sources': [ 378 'sources': [
361 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc', 379 '<(SHARED_INTERMEDIATE_DIR)/chrome_version/chrome_dll_version.rc',
362 'app/chrome_main.cc', 380 'app/chrome_main.cc',
363 'app/chrome_main_delegate.cc', 381 'app/chrome_main_delegate.cc',
364 'app/chrome_main_delegate.h', 382 'app/chrome_main_delegate.h',
365 ], 383 ],
366 'conditions': [ 384 'conditions': [
367 ['OS=="win"', { 385 ['OS=="win"', {
368 'dependencies': [ 386 'dependencies': [
369 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf', 387 '<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf',
370 ], 388 ],
389 'conditions': [
390 ['chrome_pgo==1', {
391 'msvs_settings': {
392 'VCLinkerTool': {
393 'LinkTimeCodeGeneration': '<(ltcg_value)',
394 'ProfileGuidedDatabase': '$(OutDir)\\chrome_child.pgd',
395 },
396 },
397 }],
398 ],
399 }],
400 # This ugly hack is required to make sure that the instrumented DLL
401 # gets linked before trying to link the optimized one.
402 # ltcg_value==3 corresponds to the /LTCG:PGOPTIMIZE option.
403 # TODO(sebmarchand): Find a cleaner way to express this dependency.
404 ['OS=="win" and chrome_pgo==1 and ltcg_value==3', {
405 'dependencies': [
406 'chrome_pgo_profile',
407 ],
371 }], 408 }],
372 ], 409 ],
373 }, # target chrome_child_dll 410 }, # target <(chrome_child_dll_target_name)
374 ], 411 ],
375 }], 412 }],
376 ], 413 ],
377 } 414 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698