Embed compatibility manifest into all *.exe files

This CL introduces an automated and centralized way to embed
compatibility manifest into all *.exe files. With this CL,
a potential risk of behavioural inconsistency between
production binaries and unit test binaries is resolved by
enforcing the same compatibility context.

This CL uses 'target_conditions' feature of gyp to inject
manifest settings into each executable target. One tricky
part is that some executables such as setup.exe and
mini_installer.exe require external manifest file instead of
embedded one when component build is enabled. 
See http://crbug.com/127233 for this.

You can override the gyp variable
'win_exe_compatibility_manifest' locally for a given
executable target to embed a custom compatibility manifest.

BUG=260692

Review URL: https://chromiumcodereview.appspot.com/19275010

git-svn-id: http://src.chromium.org/svn/trunk/src/build@214427 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
Yukawa@chromium.org 2013-07-30 20:24:30 +00:00
Родитель b9ab97b92f
Коммит 3c0353800c
2 изменённых файлов: 45 добавлений и 0 удалений

Просмотреть файл

@ -1789,6 +1789,17 @@
# See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
'win_debug_disable_iterator_debugging%': '0',
# An application manifest fragment to declare compatibility settings for
# 'executable' targets. Ignored in other target type.
'win_exe_compatibility_manifest%':
'<(DEPTH)\\build\\win\\compatibility.manifest',
# Set to 1 to generate external manifest instead of embedding it for
# 'executable' target. Does nothing for other target type. This flag is
# used to make mini_installer compatible with the component build.
# See http://crbug.com/127233
'win_use_external_manifest%': 0,
'release_extra_cflags%': '',
'debug_extra_cflags%': '',
@ -4471,6 +4482,25 @@
'<(SHARED_INTERMEDIATE_DIR)',
],
},
'target_conditions': [
['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
'VCManifestTool': {
'AdditionalManifestFiles': [
'>(win_exe_compatibility_manifest)',
],
},
}],
['_type=="executable" and >(win_use_external_manifest)==0', {
'VCManifestTool': {
'EmbedManifest': 'true',
}
}],
['_type=="executable" and >(win_use_external_manifest)==1', {
'VCManifestTool': {
'EmbedManifest': 'false',
}
}],
],
},
},
}],

Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--The ID below indicates application support for Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--The ID below indicates application support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
</application>
</compatibility>
</assembly>