fast_build.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/python
  2. # Builds and packages the editor. Make sure you have MSBuild
  3. # installed and the path is valid.
  4. # Usage: "fastBuild $Configuration $Platform"
  5. # Where: $Configuration - e.g. Debug, OptimizedDebug, Release
  6. # Where: $Platform - x86, x64
  7. import sys
  8. import os
  9. import multiprocessing
  10. msbuildPath = "C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\amd64"
  11. buildPath = "..\\Build\\VS2015\\"
  12. configuration = sys.argv[1]
  13. platform = sys.argv[2]
  14. def compileWorker(project):
  15. projectPath = buildPath + "\\" + project + "\\" + project + ".vcxproj"
  16. os.system("msbuild {0} /t:ClCompile /p:Configuration={1};Platform={2}".format(projectPath, configuration, platform))
  17. return
  18. if __name__ == '__main__':
  19. solutionPath = buildPath + "Banshee.sln"
  20. projects = ["BansheeUtility", "BansheeCore", "BansheeEngine", "BansheeMono",
  21. "BansheeEditor", "SBansheeEngine", "BansheeFBXImporter", "BansheeFontImporter",
  22. "BansheeFreeImgImporter", "BansheeD3D11RenderAPI", "BansheeOISInput", "BansheeOpenAudio",
  23. "BansheePhysX", "BansheeSL", "RenderBeast", "SBansheeEditor", "BansheeGLRenderAPI",
  24. "BansheeVulkanRenderAPI", "BansheeEditorExec", "Game"]
  25. if not os.path.exists(msbuildPath):
  26. print("MSBuild path is not valid. Used path {0}: ".format(msbuildPath))
  27. exit;
  28. os.environ["PATH"] += os.pathsep + msbuildPath
  29. # Clean entire solution
  30. os.system("msbuild {0} /t:Clean /p:Configuration={1};Platform={2} /m".format(solutionPath, configuration, platform))
  31. # Launch a compile thread for every project
  32. pool = multiprocessing.Pool(multiprocessing.cpu_count())
  33. pool.map(compileWorker, projects)
  34. # Link all projects
  35. os.system("msbuild {0} /p:Configuration={1};Platform={2} /m".format(solutionPath, configuration, platform))
  36. #for project in projects:
  37. # projectPath = buildPath + "\\" + project + "\\" + project + ".vcxproj"
  38. # os.system("msbuild {0} /t:Link /p:Configuration={1};Platform={2} /m".format(projectPath, configuration, platform))