9
9
# 'profile' to build on the Profile configuration
10
10
11
11
PROJECT_NAME = "GITechDemo"
12
- DEFAULT_VSCOMNTOOLS = "VS140COMNTOOLS "
12
+ DEFAULT_VSCOMNTOOLS = "VS100COMNTOOLS "
13
13
FORCE_REBUILD = False
14
14
BUILD_CONFIGURATION = "Release"
15
15
@@ -55,15 +55,15 @@ def copytree(src, dst, symlinks = False, ignore = None):
55
55
else :
56
56
shutil .copy2 (s , d )
57
57
58
- def buildsln (pathToTools , platform , buildConfig ):
59
- cmd = " \" " + pathToTools + "VsDevCmd.bat \" && "
60
- cmd += " MSBuild.exe /maxcpucount /p:Configuration=" + buildConfig + " /p:Platform=" + platform
58
+ def buildsln (pathToTools , envSetupBat , platform , buildConfig ):
59
+ os . environ [ "PATH" ] += os . pathsep + pathToTools
60
+ cmd = envSetupBat + " && MSBuild.exe /maxcpucount /p:Configuration=" + buildConfig + " /p:Platform=" + platform
61
61
if (FORCE_REBUILD ):
62
62
cmd += " /t:rebuild "
63
63
else :
64
64
cmd += " "
65
- cmd += os .getcwd () + "/../Code/Solutions/"
66
- cmd += PROJECT_NAME + ".sln"
65
+ cmd += " \" " + os .getcwd () + "/../Code/Solutions/"
66
+ cmd += PROJECT_NAME + ".sln\" "
67
67
#print(cmd)
68
68
os .system (cmd )
69
69
@@ -79,8 +79,16 @@ def buildsln(pathToTools, platform, buildConfig):
79
79
80
80
print ("\n Starting build process...\n " )
81
81
82
+ envSetupBat = "VsDevCmd.bat"
83
+
82
84
if (os .getenv (DEFAULT_VSCOMNTOOLS )):
83
85
pathToTools = os .getenv (DEFAULT_VSCOMNTOOLS )
86
+ if (
87
+ DEFAULT_VSCOMNTOOLS == "VS100COMNTOOLS" or
88
+ DEFAULT_VSCOMNTOOLS == "VS90COMNTOOLS" or
89
+ DEFAULT_VSCOMNTOOLS == "VS80COMNTOOLS"
90
+ ):
91
+ envSetupBat = "vsvars32.bat"
84
92
elif (os .getenv ("VS140COMNTOOLS" )): # Visual Studio 2015
85
93
pathToTools = os .getenv ("VS140COMNTOOLS" )
86
94
elif (os .getenv ("VS120COMNTOOLS" )): # Visual Studio 2013
@@ -89,16 +97,19 @@ def buildsln(pathToTools, platform, buildConfig):
89
97
pathToTools = os .getenv ("VS110COMNTOOLS" )
90
98
elif (os .getenv ("VS100COMNTOOLS" )): # Visual Studio 2010
91
99
pathToTools = os .getenv ("VS100COMNTOOLS" )
100
+ envSetupBat = "vsvars32.bat"
92
101
#elif(os.getenv("VS90COMNTOOLS")): # Visual Studio 2008
93
102
# pathToTools = os.getenv("VS90COMNTOOLS")
103
+ # envSetupBat = "vsvars32.bat"
94
104
#elif(os.getenv("VS80COMNTOOLS")): # Visual Studio 2005
95
105
# pathToTools = os.getenv("VS80COMNTOOLS")
106
+ # envSetupBat = "vsvars32.bat"
96
107
else :
97
108
print ("No compatible version of Visual Studio found!\n " )
98
109
99
110
if (pathToTools ):
100
- buildsln (pathToTools , "x86" , BUILD_CONFIGURATION )
101
- buildsln (pathToTools , "x64" , BUILD_CONFIGURATION )
111
+ buildsln (pathToTools , envSetupBat , "x86" , BUILD_CONFIGURATION )
112
+ buildsln (pathToTools , envSetupBat , "x64" , BUILD_CONFIGURATION )
102
113
103
114
print ("\n Configuring build...\n " )
104
115
0 commit comments