Index: chrome/chrome_dll.gypi |
diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi |
index 13756e105d071a7e2c7d19b3a42a87dea3e1f791..98417b73bb4dd6d1ee8a349bedc8a02423cef0b7 100644 |
--- a/chrome/chrome_dll.gypi |
+++ b/chrome/chrome_dll.gypi |
@@ -6,10 +6,10 @@ |
['OS=="mac" or OS=="win"', { |
'targets': [ |
{ |
- 'target_name': 'chrome_dll', |
+ 'target_name': '<(chrome_dll_target_name)', |
'type': 'none', |
'dependencies': [ |
- 'chrome_main_dll', |
+ '<(chrome_main_dll_target_name)', |
], |
'conditions': [ |
['OS=="mac" and component=="shared_library"', { |
@@ -23,7 +23,7 @@ |
}], # OS=="mac" |
['chrome_multiple_dll==1', { |
'dependencies': [ |
- 'chrome_child_dll', |
+ '<(chrome_child_dll_target_name)', |
], |
}], |
['incremental_chrome_dll==1', { |
@@ -37,14 +37,14 @@ |
{ |
'action_name': 'hardlink_to_output', |
'inputs': [ |
- '$(OutDir)\\initial\\chrome.dll', |
+ '$(OutDir)\\initial\\<(chrome_main_dll_product_name).dll', |
], |
'outputs': [ |
- '$(OutDir)\\chrome.dll', |
+ '$(OutDir)\\<(chrome_main_dll_product_name).dll', |
], |
'action': ['tools\\build\\win\\hardlink_failsafe.bat', |
- '$(OutDir)\\initial\\chrome.dll', |
- '$(OutDir)\\chrome.dll'], |
+ '$(OutDir)\\initial\\<(chrome_main_dll_product_name).dll', |
+ '$(OutDir)\\<(chrome_main_dll_product_name).dll'], |
}, |
], |
'conditions': [ |
@@ -55,14 +55,14 @@ |
'action_name': 'hardlink_pdb_to_output', |
'inputs': [ |
# Not the pdb, since gyp doesn't know about it |
- '$(OutDir)\\initial\\chrome.dll', |
+ '$(OutDir)\\initial\\<(chrome_main_dll_product_name).dll', |
], |
'outputs': [ |
- '$(OutDir)\\chrome.dll.pdb', |
+ '$(OutDir)\\<(chrome_main_dll_product_name).dll.pdb', |
], |
'action': ['tools\\build\\win\\hardlink_failsafe.bat', |
- '$(OutDir)\\initial\\chrome.dll.pdb', |
- '$(OutDir)\\chrome.dll.pdb'], |
+ '$(OutDir)\\initial\\<(chrome_main_dll_product_name).pdb', |
+ '$(OutDir)\\<(chrome_main_dll_product_name).pdb'], |
} |
] |
}] |
@@ -71,7 +71,7 @@ |
] |
}, |
{ |
- 'target_name': 'chrome_main_dll', |
+ 'target_name': '<(chrome_main_dll_target_name)', |
'type': 'shared_library', |
'variables': { |
'enable_wexit_time_destructors': 1, |
@@ -87,6 +87,15 @@ |
'<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf', |
], |
}], |
+ # This ugly hack is required to make sure that the instrumented DLL |
+ # gets linked before trying to link the optimized one. |
+ # ltcg_value==3 corresponds to the /LTCG:PGOPTIMIZE option. |
+ # TODO(sebmarchand): Find a cleaner way to express this dependency. |
+ ['OS=="win" and chrome_pgo==1 and ltcg_value==3', { |
+ 'dependencies': [ |
+ 'chrome_pgo_profile', |
+ ], |
+ }], |
['use_aura==1', { |
'dependencies': [ |
'../ui/compositor/compositor.gyp:compositor', |
@@ -100,7 +109,7 @@ |
], |
},], |
['OS=="win"', { |
- 'product_name': 'chrome', |
+ 'product_name': '<(chrome_main_dll_product_name)', |
'dependencies': [ |
# On Windows, link the dependencies (libraries) that make |
# up actual Chromium functionality into this .dll. |
@@ -147,7 +156,7 @@ |
'SubSystem': '2', |
'conditions': [ |
['incremental_chrome_dll==1', { |
- 'OutputFile': '$(OutDir)\\initial\\chrome.dll', |
+ 'OutputFile': '$(OutDir)\\initial\\<(chrome_main_dll_product_name)', |
'UseLibraryDependencyInputs': "true", |
}], |
['target_arch=="ia32"', { |
@@ -220,6 +229,14 @@ |
'chrome_dll_pdb_workaround', |
], |
}], |
+ ['chrome_pgo==1', { |
+ 'msvs_settings': { |
+ 'VCLinkerTool': { |
+ 'LinkTimeCodeGeneration': '<(ltcg_value)', |
+ 'ProfileGuidedDatabase': '$(OutDir)\\chrome.pgd', |
+ }, |
+ }, |
+ }], |
] |
}], |
['chrome_multiple_dll==1', { |
@@ -312,14 +329,14 @@ |
], # conditions |
}], # OS=="mac" |
], # conditions |
- }, # target chrome_main_dll |
+ }, # target <(chrome_main_dll_target_name) |
], # targets |
}], # OS=="mac" or OS=="win" |
['OS=="win"', { |
'targets': [ |
{ |
# This target is only depended upon on Windows. |
- 'target_name': 'chrome_dll_pdb_workaround', |
+ 'target_name': '<(chrome_dll_target_name)_pdb_workaround', |
'type': 'static_library', |
'sources': [ 'empty_pdb_workaround.cc' ], |
'conditions': [ |
@@ -330,7 +347,8 @@ |
# output by the final link. See empty_pdb_workaround.cc for |
# more details. |
'DebugInformationFormat': '3', |
- 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/chrome.dll.pdb', |
+ 'ProgramDataBaseFileName': |
+ '<(PRODUCT_DIR)/<(chrome_main_dll_product_name).dll.pdb', |
}, |
}, |
}], |
@@ -341,9 +359,9 @@ |
['chrome_multiple_dll', { |
'targets': [ |
{ |
- 'target_name': 'chrome_child_dll', |
+ 'target_name': '<(chrome_child_dll_target_name)', |
'type': 'shared_library', |
- 'product_name': 'chrome_child', |
+ 'product_name': '<(chrome_child_dll_product_name)', |
'variables': { |
'enable_wexit_time_destructors': 1, |
}, |
@@ -368,9 +386,28 @@ |
'dependencies': [ |
'<(DEPTH)/chrome_elf/chrome_elf.gyp:chrome_elf', |
], |
+ 'conditions': [ |
+ ['chrome_pgo==1', { |
+ 'msvs_settings': { |
+ 'VCLinkerTool': { |
+ 'LinkTimeCodeGeneration': '<(ltcg_value)', |
+ 'ProfileGuidedDatabase': '$(OutDir)\\chrome_child.pgd', |
+ }, |
+ }, |
+ }], |
+ ], |
+ }], |
+ # This ugly hack is required to make sure that the instrumented DLL |
+ # gets linked before trying to link the optimized one. |
+ # ltcg_value==3 corresponds to the /LTCG:PGOPTIMIZE option. |
+ # TODO(sebmarchand): Find a cleaner way to express this dependency. |
+ ['OS=="win" and chrome_pgo==1 and ltcg_value==3', { |
+ 'dependencies': [ |
+ 'chrome_pgo_profile', |
+ ], |
}], |
], |
- }, # target chrome_child_dll |
+ }, # target <(chrome_child_dll_target_name) |
], |
}], |
], |