]> xenbits.xensource.com Git - pvdrivers/win/xencons.git/commitdiff
Add BUILD.md and fix final package location
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 18 May 2017 11:05:54 +0000 (12:05 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 18 May 2017 11:05:54 +0000 (12:05 +0100)
Microsoft helpfully removed the PackageDir property from package projects
in VS2015 so, as an interim fix, OutDir was used. This unfortunately means
that package output ends up in xencons/<arch>/package rather than just
xencons/<arch>.

This patch fixes the final package location by using python to do the
final copy (replacing what older VS used to do) and also adds a BUILD.md,
which was missing.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
BUILD.md [new file with mode: 0644]
build.py
vs2015/package/package.vcxproj

diff --git a/BUILD.md b/BUILD.md
new file mode 100644 (file)
index 0000000..1e1402f
--- /dev/null
+++ b/BUILD.md
@@ -0,0 +1,45 @@
+Building the XenCons Package
+============================
+
+First you'll need a device driver build environment for Windows 10.
+This means:
+
+*   Visual Studio 2015 (Any SKU, including Express or Community)
+*   Windows Driver Kit 10
+
+Install Visual Studio first (you only need install MFC for C++) and then
+the WDK. Set an environment variable called VS to the base of the Visual
+Studio Installation (e.g. C:\Program Files\Microsoft Visual Studio 14.0) and
+a variable called KIT to the base of the WDK
+(e.g. C:\Program Files\Windows Kits\10). Also set an environment variable
+called SYMBOL\_SERVER to point at a location where driver symbols can be
+stored. This can be local directory e.g. C:\Symbols.
+
+You will also need to acquire the DIFx re-distributable package from one
+of the older WDKs (as it appears not to be present in WDK10), so that the
+driver build can copy dpinst.exe into the output.
+Set the environment variable DPINST_REDIST to the base dpinst directory
+- the directory under which the x86 and x64 sub-directories containing
+dpinst.exe can be found
+(e.g. C:\Program Files (x86)\Windows Kits\8.1\Redist\DIFx\dpinst\EngMui)
+
+Next you'll need a 3.x version of python (which you can get from
+http://www.python.org). Make sure python.exe is somewhere on your default
+path.
+
+Now fire up a Command Prompt and navigate to the base of your git repository.
+At the prompt type:
+
+    build.py checked
+
+This will create a debug build of the driver. To create a non-debug build
+type:
+
+    build.py free
+
+Note that Static Driver Verifier is run by default as part of the build
+process. This can be very time consuming. If you don't want to run the
+verifier then you can add the 'nosdv' keyword to the end of your command
+e.g.:
+
+    build.py free nosdv
index f7031ca5f1e970d15d9dcebf3d2e446ec3eb782e..710b234a8769517ff8d5dacc2395f46e2fc72c6f 100644 (file)
--- a/build.py
+++ b/build.py
@@ -205,6 +205,28 @@ def build_sln(name, release, arch, debug, vs):
 
     msbuild(platform, configuration, 'Build', name + '.sln', '', vs)
 
+def copy_package(name, release, arch, debug, vs):
+    configuration = get_configuration(release, debug)
+
+    if arch == 'x86':
+        platform = 'Win32'
+    elif arch == 'x64':
+        platform = 'x64'
+
+    pattern = '/'.join([vs, ''.join(configuration.split(' ')), platform, 'package', '*'])
+    print('Copying package from %s' % pattern)
+
+    files = glob.glob(pattern)
+
+    dst = os.path.join(name, arch)
+
+    os.makedirs(dst, exist_ok=True)
+
+    for file in files:
+        new = shutil.copy(file, dst)
+        print(new)
+
+    print('')
 
 def remove_timestamps(path):
     try:
@@ -398,8 +420,13 @@ if __name__ == '__main__':
                 'vs2013':'Windows 7',
                 'vs2015':'Windows 8' }
 
+    shutil.rmtree(driver, ignore_errors=True)
+
     build_sln(driver, release[vs], 'x86', debug[sys.argv[1]], vs)
+    copy_package(driver, release[vs], 'x86', debug[sys.argv[1]], vs)
+
     build_sln(driver, release[vs], 'x64', debug[sys.argv[1]], vs)
+    copy_package(driver, release[vs], 'x64', debug[sys.argv[1]], vs)
 
     symstore_add(driver, release[vs], 'x86', debug[sys.argv[1]], vs)
     symstore_add(driver, release[vs], 'x64', debug[sys.argv[1]], vs)
index 2e5c0eb472a44224c9c87f7d1e5703ec77d23a7a..a8c07278e8a8d3786b84d70d140f0c8628d59b37 100644 (file)
@@ -30,7 +30,7 @@
     <VerifyDrivers />
     <VerifyFlags>133563</VerifyFlags>
     <IntDir>..\$(ProjectName)\$(ConfigurationName)\$(Platform)\</IntDir>
-    <OutDir>..\..\xencons\$(DDKPlatform)\</OutDir>
+    <OutDir>..\$(ConfigurationName)\$(Platform)\</OutDir>
   </PropertyGroup>
   <ItemGroup>
     <ProjectReference Include="..\xencons\xencons.vcxproj">