# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{
  'variables': {
    'chromium_code': 1,
  },
  'target_defaults': {
    'include_dirs': [
      '<(DEPTH)',
    ],
  },
  'targets': [
    {
      'target_name': 'run_in_snapshot',
      'type': 'executable',
      'sources': [
        'run_in_snapshot.cc'
      ],
      'dependencies': [
        '<(DEPTH)/base/base.gyp:base',
      ],
      'libraries': [
        'vssapi.lib',
      ],
    },
    {
      # The XP version of this executable needs to build against the VSS SDK.
      # We bring this about by changing the include and library settings for
      # this target. Note, however that this needs the VSS SDK to be installed
      # in the default location at C:\Program Files (x86)\Microsoft\VSSSDK72.
      'target_name': 'run_in_snapshot_xp',
      'type': 'executable',
      'sources': [
        'run_in_snapshot.cc'
      ],
      'dependencies': [
        '<(DEPTH)/base/base.gyp:base',
      ],
      'libraries': [
        'vssapi.lib',
      ],
      'msvs_settings': {
        'VCCLCompilerTool': {
          'AdditionalIncludeDirectories': [
            'C:\Program Files (x86)\Microsoft\VSSSDK72\inc\winxp',
          ],
        },
        'VCLinkerTool': {
          'AdditionalLibraryDirectories': [
            'C:\Program Files (x86)\Microsoft\VSSSDK72\lib\winxp\obj\i386',
          ],
          'AdditionalDependencies': [
            'vssapi.lib',
          ],
        },
      },
    },
    {
      # For Vista/Win7 x64 installs we need an x64 executable. Even though the
      # API is very COM-like, it won't cross the bitness divide for us.
      'target_name': 'run_in_snapshot_x64',
      'type': 'executable',
      'sources': [
        'run_in_snapshot.cc'
      ],
      'dependencies': [
        '<(DEPTH)/base/base.gyp:base_nacl_win64',
      ],
      'libraries': [
        'vssapi.lib',
      ],
      'configurations': {
        'Common_Base': {
          'msvs_target_platform': 'x64',
        },
      },
    },
  ]
}

@@ -1089,21 +1089,23 @@
  by 
-chang
+prepend
 ing the 
 incl
@@ -1100,16 +1100,36 @@
 ing the 
+the VSS SDKs to the 
 include 
@@ -1131,16 +1131,24 @@
 lude and
+%0A      #
  library
@@ -1152,28 +1152,17 @@
 ary 
-settings for%0A      #
+paths for
  thi
@@ -1170,16 +1170,24 @@
  target.
+%0A      #
  Note, h
@@ -1231,94 +1231,226 @@
  be 
-installed%0A      # in the default location at C:%5CProgram Files (x86)%5CMicrosoft%5CVSSSDK72
+present in%0A      # ..%5C..%5Cthird_party%5Cvsssdk72%5Cfiles. If the VSS SDK is not present%0A      # there, the binary produced will be identical to the run_in_snapshot%0A      # binary, and will not successfully run on Windows XP
 .%0A  
@@ -1785,32 +1785,33 @@
 cludeDirectories
++
 ': %5B%0A           
@@ -1816,54 +1816,48 @@
    '
-C:%5CProgram Files (x86)%5CMicrosoft%5CVSSSDK72%5Cinc%5C
+%3C(DEPTH)/third_party/vsssdk72/files/inc/
 winx
@@ -1945,24 +1945,25 @@
 yDirectories
++
 ': %5B%0A       
@@ -1972,64 +1972,58 @@
    '
-C:%5CProgram Files (x86)%5CMicrosoft%5CVSSSDK72%5Clib%5C
+%3C(DEPTH)/third_party/vsssdk72/files/lib/
 winxp
-%5Cobj%5C
+/obj/
 i386

Fix build configuration to refer to the VSS SDK at third_party. Review URL: http://codereview.appspot.com/4536087