forked from YoutaVen/Vulkan
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_build_all_MSVC.py
83 lines (57 loc) · 1.93 KB
/
create_build_all_MSVC.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import os
import subprocess
import sys
import threading
####################
#
# Functions
#
####################
class BuildThread (threading.Thread):
def __init__(self, buildDirectory, buildOption):
threading.Thread.__init__(self)
self.buildDirectory = buildDirectory
self.buildOption = buildOption
def run(self):
print("Processing '%s' ..." % (self.buildDirectory))
directory = os.getcwd() + "/" + self.buildDirectory
subprocess.call("cmake -H%s -B%s %s" % (directory, directory + "/MSVC",self.buildOption), shell=True)
subprocess.call("msbuild %s.sln /p:Configuration=Release" % (directory + "/MSVC/" + self.buildDirectory), shell=True)
print("Finished '%s'." % (self.buildDirectory))
####################
#
# Main
#
####################
#
# Pass '64bit' for 64bit project files.
#
print("Creating and building all MSVC projects ...")
#
currentArchitecture = ""
for x in range(1, len(sys.argv)):
if sys.argv[x] == '64bit':
currentArchitecture = " " + '-G "Visual Studio 14 2015 Win64"'
option = " -DCMAKE_BUILD_TYPE=Release" + currentArchitecture
#
allBuildThreads = []
allVKTS = os.listdir()
for package in allVKTS:
if package.startswith("VKTS_PKG"):
currentBuildThread = BuildThread(package, option)
allBuildThreads.append(currentBuildThread)
currentBuildThread.start()
for currentBuildThread in allBuildThreads:
currentBuildThread.join()
#
allBuildThreads = []
allVKTS = os.listdir()
for package in allVKTS:
if package.startswith("VKTS_Example") or package.startswith("VKTS_Test"):
currentBuildThread = BuildThread(package, option)
allBuildThreads.append(currentBuildThread)
currentBuildThread.start()
for currentBuildThread in allBuildThreads:
currentBuildThread.join()
#
print("Done.")