|  | @@ -234,15 +234,17 @@ class CLanguage(object):
 | 
	
		
			
				|  |  |    def configure(self, config, args):
 | 
	
		
			
				|  |  |      self.config = config
 | 
	
		
			
				|  |  |      self.args = args
 | 
	
		
			
				|  |  | -    if self.args.compiler == 'cmake':
 | 
	
		
			
				|  |  | +    if self.platform == 'windows':
 | 
	
		
			
				|  |  | +      _check_compiler(self.args.compiler, ['default', 'cmake'])
 | 
	
		
			
				|  |  | +      _check_arch(self.args.arch, ['default', 'x64', 'x86'])
 | 
	
		
			
				|  |  | +      self._cmake_arch_option = 'x64' if self.args.arch == 'x64' else 'Win32'
 | 
	
		
			
				|  |  | +      self._use_cmake = True
 | 
	
		
			
				|  |  | +      self._make_options = []
 | 
	
		
			
				|  |  | +    elif self.args.compiler == 'cmake':
 | 
	
		
			
				|  |  |        _check_arch(self.args.arch, ['default'])
 | 
	
		
			
				|  |  |        self._use_cmake = True
 | 
	
		
			
				|  |  |        self._docker_distro = 'jessie'
 | 
	
		
			
				|  |  |        self._make_options = []
 | 
	
		
			
				|  |  | -    elif self.platform == 'windows':
 | 
	
		
			
				|  |  | -      self._use_cmake = False
 | 
	
		
			
				|  |  | -      self._make_options = [_windows_toolset_option(self.args.compiler),
 | 
	
		
			
				|  |  | -                            _windows_arch_option(self.args.arch)]
 | 
	
		
			
				|  |  |      else:
 | 
	
		
			
				|  |  |        self._use_cmake = False
 | 
	
		
			
				|  |  |        self._docker_distro, self._make_options = self._compiler_options(self.args.use_docker,
 | 
	
	
		
			
				|  | @@ -303,13 +305,7 @@ class CLanguage(object):
 | 
	
		
			
				|  |  |          if self.args.iomgr_platform in target.get('exclude_iomgrs', []):
 | 
	
		
			
				|  |  |            continue
 | 
	
		
			
				|  |  |          if self.platform == 'windows':
 | 
	
		
			
				|  |  | -          if self._use_cmake:
 | 
	
		
			
				|  |  | -            binary = 'cmake/build/%s/%s.exe' % (_MSBUILD_CONFIG[self.config.build_config], target['name'])
 | 
	
		
			
				|  |  | -          else:
 | 
	
		
			
				|  |  | -            binary = 'vsprojects/%s%s/%s.exe' % (
 | 
	
		
			
				|  |  | -                'x64/' if self.args.arch == 'x64' else '',
 | 
	
		
			
				|  |  | -                _MSBUILD_CONFIG[self.config.build_config],
 | 
	
		
			
				|  |  | -                target['name'])
 | 
	
		
			
				|  |  | +          binary = 'cmake/build/%s/%s.exe' % (_MSBUILD_CONFIG[self.config.build_config], target['name'])
 | 
	
		
			
				|  |  |          else:
 | 
	
		
			
				|  |  |            if self._use_cmake:
 | 
	
		
			
				|  |  |              binary = 'cmake/build/%s' % target['name']
 | 
	
	
		
			
				|  | @@ -370,16 +366,12 @@ class CLanguage(object):
 | 
	
		
			
				|  |  |      return self._make_options;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    def pre_build_steps(self):
 | 
	
		
			
				|  |  | -    if self._use_cmake:
 | 
	
		
			
				|  |  | -      if self.platform == 'windows':
 | 
	
		
			
				|  |  | -        return [['tools\\run_tests\\helper_scripts\\pre_build_cmake.bat']]
 | 
	
		
			
				|  |  | -      else:
 | 
	
		
			
				|  |  | -        return [['tools/run_tests/helper_scripts/pre_build_cmake.sh']]
 | 
	
		
			
				|  |  | +    if self.platform == 'windows':
 | 
	
		
			
				|  |  | +      return [['tools\\run_tests\\helper_scripts\\pre_build_cmake.bat', self._cmake_arch_option]]
 | 
	
		
			
				|  |  | +    elif self._use_cmake:
 | 
	
		
			
				|  |  | +      return [['tools/run_tests/helper_scripts/pre_build_cmake.sh']]
 | 
	
		
			
				|  |  |      else:
 | 
	
		
			
				|  |  | -      if self.platform == 'windows':
 | 
	
		
			
				|  |  | -        return [['tools\\run_tests\\helper_scripts\\pre_build_c.bat']]
 | 
	
		
			
				|  |  | -      else:
 | 
	
		
			
				|  |  | -        return []
 | 
	
		
			
				|  |  | +      return []
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    def build_steps(self):
 | 
	
		
			
				|  |  |      return []
 | 
	
	
		
			
				|  | @@ -1111,30 +1103,6 @@ def _check_arch_option(arch):
 | 
	
		
			
				|  |  |        sys.exit(1)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -def _windows_build_bat(compiler):
 | 
	
		
			
				|  |  | -  """Returns name of build.bat for selected compiler."""
 | 
	
		
			
				|  |  | -  # For CoreCLR, fall back to the default compiler for C core
 | 
	
		
			
				|  |  | -  if compiler == 'default' or compiler == 'vs2013':
 | 
	
		
			
				|  |  | -    return 'vsprojects\\build_vs2013.bat'
 | 
	
		
			
				|  |  | -  elif compiler == 'vs2015':
 | 
	
		
			
				|  |  | -    return 'vsprojects\\build_vs2015.bat'
 | 
	
		
			
				|  |  | -  else:
 | 
	
		
			
				|  |  | -    print('Compiler %s not supported.' % compiler)
 | 
	
		
			
				|  |  | -    sys.exit(1)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -def _windows_toolset_option(compiler):
 | 
	
		
			
				|  |  | -  """Returns msbuild PlatformToolset for selected compiler."""
 | 
	
		
			
				|  |  | -  # For CoreCLR, fall back to the default compiler for C core
 | 
	
		
			
				|  |  | -  if compiler == 'default' or compiler == 'vs2013' or compiler == 'coreclr':
 | 
	
		
			
				|  |  | -    return '/p:PlatformToolset=v120'
 | 
	
		
			
				|  |  | -  elif compiler == 'vs2015':
 | 
	
		
			
				|  |  | -    return '/p:PlatformToolset=v140'
 | 
	
		
			
				|  |  | -  else:
 | 
	
		
			
				|  |  | -    print('Compiler %s not supported.' % compiler)
 | 
	
		
			
				|  |  | -    sys.exit(1)
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  def _docker_arch_suffix(arch):
 | 
	
		
			
				|  |  |    """Returns suffix to dockerfile dir to use."""
 | 
	
		
			
				|  |  |    if arch == 'default' or arch == 'x64':
 | 
	
	
		
			
				|  | @@ -1233,7 +1201,6 @@ argp.add_argument('--compiler',
 | 
	
		
			
				|  |  |                    choices=['default',
 | 
	
		
			
				|  |  |                             'gcc4.4', 'gcc4.6', 'gcc4.8', 'gcc4.9', 'gcc5.3', 'gcc_musl',
 | 
	
		
			
				|  |  |                             'clang3.4', 'clang3.5', 'clang3.6', 'clang3.7',
 | 
	
		
			
				|  |  | -                           'vs2013', 'vs2015',
 | 
	
		
			
				|  |  |                             'python2.7', 'python3.4', 'python3.5', 'python3.6', 'pypy', 'pypy3', 'python_alpine',
 | 
	
		
			
				|  |  |                             'node0.12', 'node4', 'node5', 'node6', 'node7', 'node8',
 | 
	
		
			
				|  |  |                             'electron1.3', 'electron1.6',
 |