www.gusucode.com > rtwdemos 工具箱matlab源码程序 > rtwdemos/crl_demo/validateSupportedCompiler.m
function validateSupportedCompiler(model) %tc = get_param(model,'Toolchain'); tc = rtwprivate('getCompilerForModel',model); crl = get_param(model,'CodeReplacementLibrary'); %%windows system MinGWcrl='Data Alignment Examples for MinGW'; othercrl='Data Alignment Examples for Non-MinGW'; if (strcmp(model,'rtwdemo_crlalignperf')) MinGWcrl='SIMD Single 5x5 Element-wise Mul for MinGW'; othercrl='SIMD Single 5x5 Element-wise Mul for Non-MinGW'; end if (~isempty(tc)) if (strcmp(crl,MinGWcrl)==1) %Mingwcrl and Non-MinGW compiler if (ispc && isempty(strfind(tc.compStr, 'GNU'))) DAStudio.error('CoderFoundation:tfl:MinGWCrlUnsupportedCompiler',crl,othercrl); end elseif (strcmp(crl,othercrl)) %we choose a Non-MinGW crl, error out when it is PC && MinGW if (ispc && ~isempty(strfind(tc.compStr, 'GNU'))) DAStudio.error('CoderFoundation:tfl:NonMinGWCrlUnsupportedCompiler',crl,MinGWcrl); end end end