Changeset c101fe1 for waflib/Tools/msvc.py
- Timestamp:
- Nov 13, 2013, 1:00:56 PM (10 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- d3066e2
- Parents:
- 54e74f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waflib/Tools/msvc.py
r54e74f0 rc101fe1 4 4 5 5 import os,sys,re,tempfile 6 from waflib import Utils,Task,Logs,Options 6 from waflib import Utils,Task,Logs,Options,Errors 7 7 from waflib.Logs import debug,warn 8 8 from waflib.TaskGen import after_method,feature … … 29 29 wintrust wldap32 wmiutils wow32 ws2_32 wsnmp32 wsock32 wst wtsapi32 xaswitch xolehlp 30 30 '''.split() 31 all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64') ]31 all_msvc_platforms=[('x64','amd64'),('x86','x86'),('ia64','ia64'),('x86_amd64','amd64'),('x86_ia64','ia64'),('x86_arm','arm')] 32 32 all_wince_platforms=[('armv4','arm'),('armv4i','arm'),('mipsii','mips'),('mipsii_fp','mips'),('mipsiv','mips'),('mipsiv_fp','mips'),('sh4','sh'),('x86','cex86')] 33 33 all_icl_platforms=[('intel64','amd64'),('em64t','amd64'),('ia32','x86'),('Itanium','ia64')] … … 67 67 echo PATH=%%PATH%% 68 68 echo INCLUDE=%%INCLUDE%% 69 echo LIB=%%LIB%% 69 echo LIB=%%LIB%%;%%LIBPATH%% 70 70 """%(vcvars,target)) 71 71 sout=conf.cmd_and_log(['cmd','/E:on','/V:on','/C',batfile.abspath()]) … … 73 73 if not lines[0]: 74 74 lines.pop(0) 75 if version=='11.0':76 if lines[0].startswith('Error'):77 conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_1)')78 else:79 for x in('Setting environment','Setting SDK environment','Intel(R) C++ Compiler','Intel Parallel Studio','Intel(R) Parallel Studio','Intel(R) Composer','Intel Corporation. All rights reserved.'):80 if lines[0].find(x)>-1:81 lines.pop(0)82 break83 else:84 debug('msvc: get_msvc_version: %r %r %r -> not found',compiler,version,target)85 conf.fatal('msvc: Could not find a valid architecture for building (get_msvc_version_2)')86 75 MSVC_PATH=MSVC_INCDIR=MSVC_LIBDIR=None 87 76 for line in lines: … … 233 222 except conf.errors.ConfigurationError: 234 223 pass 235 versions.append(('msvc '+version,targets)) 224 if targets: 225 versions.append(('msvc '+version,targets)) 236 226 @conf 237 227 def gather_wince_targets(conf,versions,version,vc_path,vsvars,supported_platforms): … … 254 244 versions.append((device+' '+version,cetargets)) 255 245 @conf 246 def gather_winphone_targets(conf,versions,version,vc_path,vsvars): 247 targets=[] 248 for target,realtarget in all_msvc_platforms[::-1]: 249 try: 250 targets.append((target,(realtarget,conf.get_msvc_version('winphone',version,target,vsvars)))) 251 except conf.errors.ConfigurationError ,e: 252 pass 253 if targets: 254 versions.append(('winphone '+version,targets)) 255 @conf 256 256 def gather_msvc_versions(conf,versions): 257 257 vc_paths=[] … … 272 272 if wince_supported_platforms and os.path.isfile(vsvars): 273 273 conf.gather_wince_targets(versions,version,vc_path,vsvars,wince_supported_platforms) 274 vsvars=os.path.join(vs_path,'VC','WPSDK','WP80','vcvarsphoneall.bat') 275 if os.path.isfile(vsvars): 276 conf.gather_winphone_targets(versions,'8.0',vc_path,vsvars) 274 277 for version,vc_path in vc_paths: 275 278 vs_path=os.path.dirname(vc_path) … … 370 373 patch_url='http://software.intel.com/en-us/forums/topic/328487' 371 374 compilervars_arch=os.path.join(path,'bin','compilervars_arch.bat') 372 vs_express_path=os.environ['VS110COMNTOOLS']+r'..\IDE\VSWinExpress.exe' 373 dev_env_path=os.environ['VS110COMNTOOLS']+r'..\IDE\devenv.exe' 374 if(r'if exist "%VS110COMNTOOLS%..\IDE\VSWinExpress.exe"'in Utils.readf(compilervars_arch)and not os.path.exists(vs_express_path)and not os.path.exists(dev_env_path)): 375 Logs.warn(('The Intel compilervar_arch.bat only checks for one Visual Studio SKU ''(VSWinExpress.exe) but it does not seem to be installed at %r. ''The intel command line set up will fail to configure unless the file %r''is patched. See: %s')%(vs_express_path,compilervars_arch,patch_url)) 375 for vscomntool in['VS110COMNTOOLS','VS100COMNTOOLS']: 376 if vscomntool in os.environ: 377 vs_express_path=os.environ[vscomntool]+r'..\IDE\VSWinExpress.exe' 378 dev_env_path=os.environ[vscomntool]+r'..\IDE\devenv.exe' 379 if(r'if exist "%VS110COMNTOOLS%..\IDE\VSWinExpress.exe"'in Utils.readf(compilervars_arch)and not os.path.exists(vs_express_path)and not os.path.exists(dev_env_path)): 380 Logs.warn(('The Intel compilervar_arch.bat only checks for one Visual Studio SKU ''(VSWinExpress.exe) but it does not seem to be installed at %r. ''The intel command line set up will fail to configure unless the file %r''is patched. See: %s')%(vs_express_path,compilervars_arch,patch_url)) 376 381 except WindowsError: 377 382 pass … … 545 550 conf.find_program('MT',path_list=path,var='MT') 546 551 v['MTFLAGS']=['/NOLOGO'] 547 conf.load('winres') 548 if not conf.env['WINRC']: 552 try: 553 conf.load('winres') 554 except Errors.WafError: 549 555 warn('Resource compiler not found. Compiling resource file is disabled') 550 556 @conf … … 564 570 v['CC_SRC_F']='' 565 571 v['CC_TGT_F']=['/c','/Fo'] 566 if v['MSVC_VERSION']>=8:567 v['CC_TGT_F']=['/FC']+v['CC_TGT_F']568 572 v['CXX_SRC_F']='' 569 573 v['CXX_TGT_F']=['/c','/Fo'] 570 if v['MSVC_VERSION']>=8: 574 if(v.MSVC_COMPILER=='msvc'and v.MSVC_VERSION>=8)or(v.MSVC_COMPILER=='wsdk'and v.MSVC_VERSION>=6): 575 v['CC_TGT_F']=['/FC']+v['CC_TGT_F'] 571 576 v['CXX_TGT_F']=['/FC']+v['CXX_TGT_F'] 572 577 v['CPPPATH_ST']='/I%s' … … 682 687 return ret 683 688 def exec_command_msvc(self,*k,**kw): 684 assert self.env['CC_NAME']=='msvc'685 689 if isinstance(k[0],list): 686 690 lst=[] … … 725 729 for k in'c cxx cprogram cxxprogram cshlib cxxshlib cstlib cxxstlib'.split(): 726 730 wrap_class(k) 731 def make_winapp(self,family): 732 append=self.env.append_unique 733 append('DEFINES','WINAPI_FAMILY=%s'%family) 734 append('CXXFLAGS','/ZW') 735 append('CXXFLAGS','/TP') 736 for lib_path in self.env.LIBPATH: 737 append('CXXFLAGS','/AI%s'%lib_path) 738 @feature('winphoneapp') 739 @after_method('process_use') 740 @after_method('propagate_uselib_vars') 741 def make_winphone_app(self): 742 make_winapp(self,'WINAPI_FAMILY_PHONE_APP') 743 conf.env.append_unique('LINKFLAGS','/NODEFAULTLIB:ole32.lib') 744 conf.env.append_unique('LINKFLAGS','PhoneAppModelHost.lib') 745 @feature('winapp') 746 @after_method('process_use') 747 @after_method('propagate_uselib_vars') 748 def make_windows_app(self): 749 make_winapp(self,'WINAPI_FAMILY_DESKTOP_APP')
Note: See TracChangeset
for help on using the changeset viewer.