Home | History | Annotate | Download | only in win_vulkan_sdk
      1 #!/usr/bin/env python
      2 #
      3 # Copyright 2016 Google Inc.
      4 #
      5 # Use of this source code is governed by a BSD-style license that can be
      6 # found in the LICENSE file.
      7 
      8 
      9 """Create the asset."""
     10 
     11 
     12 import argparse
     13 import shutil
     14 import sys
     15 import os
     16 
     17 
     18 def create_asset(target_dir, sdk_path, runtime_path):
     19   """Create the asset."""
     20   if not os.path.isdir(target_dir):
     21     os.makedirs(target_dir)
     22   shutil.copytree(sdk_path, target_dir)
     23   shutil.copyfile(runtime_path, os.path.join(target_dir, "vulkan-1.dll"))
     24 
     25 def main():
     26   if sys.platform != 'win32':
     27     print >> sys.stderr, 'This script only runs on Windows.'
     28     sys.exit(1)
     29   parser = argparse.ArgumentParser()
     30   parser.add_argument('--target_dir', '-t', required=True)
     31   parser.add_argument('--sdk_path', '-s', required=True)
     32   parser.add_argument('--runtime_path', '-r',
     33       default=os.path.join("C:","System32","vulkan-1.dll"),
     34       required=True)
     35   args = parser.parse_args()
     36   create_asset(args.target_dir, args.sdk_path, args.runtime_path)
     37 
     38 
     39 if __name__ == '__main__':
     40   main()
     41