gusucode.com > private工具箱matlab源码程序 > private/code_append_libs_to_objlist_file_msvc.m

    function libList = code_append_libs_to_objlist_file_msvc(objListFile, targetDirName , ...
    buildInfo, group, excludeGroups)

% [LIBLIST] = CODE_APPEND_LIBS_TO_OBJLIST_FILE_MSVC(FILENAMEINFO, BUILDINFO, GROUP)
% group can be either 'LINK_MACHINE_LIBS' or 'TMWLIB'

%   Copyright 2014-2015 The MathWorks, Inc.

    if nargin < 5
        excludeGroups = {};
    end
    fileName = fullfile(targetDirName,objListFile);
    file = fopen(fileName,'At');
    if file<3
        construct_coder_error([],sprintf('Failed to create file: %s.',fileName),1);
    end
    
    % Add LINK_MACHINE_LIBS into OBJFILE_LIST due to g1205457
    linkObjs = buildInfo.getLinkObjects(group,excludeGroups);
    libList = cell(1, numel(linkObjs));
    for i = 1:numel(linkObjs)
        currLinkObjPath = linkObjs(i).Path;
        currLinkObjPath = strrep(currLinkObjPath,'$(MATLAB_ROOT)',matlabroot);
        fullfileName = fullfile(currLinkObjPath,linkObjs(i).Name);
        if isequal(group, 'LINK_MACHINE_OBJLIST') 
            linkObjStr = fileread(fullfileName); 
            linkObjStr = regexprep(linkObjStr, '[\n\r]+',sprintf('\n'));
        else
            linkObjStr = ['"' fullfileName '"'];
        end
fprintf(file,'%s\n',linkObjStr);
    end   

    fclose(file);