Commits

Leonard Ritter  committed 30c5599

mksdl: checkout and auto-build SDL on windows

  • Participants
  • Parent commits 73c13c5

Comments (0)

Files changed (1)

File utils/mksdl.py

     if not clone_repo():
         return
     builddir = os.path.join(targetdir, 'VisualC', 'SDL', 'Release')
-    if not os.path.isdir(builddir):
-        print("You must build the visual studio solution file in release mode first.")
+    slnfile = os.path.join(targetdir, 'VisualC', 'SDL_VS2008.sln')
+    
+    DXSDK_DIR = os.environ['DXSDK_DIR']
+    
+    os.environ['INCLUDE'] = os.path.join(DXSDK_DIR, 'Include') + os.pathsep + os.environ.get('INCLUDE', '')
+    os.environ['LIB'] = os.path.join(DXSDK_DIR, 'Lib', 'x86') + os.pathsep + os.environ.get('LIB', '')
+    
+    cmd = 'msbuild {} /nologo /v:minimal /p:"VCBuildAdditionalOptions= /useenv" /p:Configuration=Release'.format(slnfile)
+    print(cmd)
+    if os.system(cmd):
+        print("build failed")
         return
+    assert os.path.isdir(builddir)
     if os.path.isdir(bindir):
         print("Removing stale {0}...".format(bindir))
         shutil.rmtree(bindir)