Changeset 14234


Ignore:
Timestamp:
Nov 29, 2019 3:03:03 PM (12 days ago)
Author:
molsson
Message:

#5843 Added framework for keeping imp lib files when compiling C-code.

Location:
branches/dev-mo-2735/Compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-mo-2735/Compiler/ModelicaCompiler/src/jastadd/ModelicaCompiler.jrag

    r14212 r14234  
    22472247                CCompilerDelegator ccompiler = getCCompiler();
    22482248                CCompilerArguments ccArgs = new CCompilerArguments(cFileName, fc.myOptions(), target, fc.externalLibraries(), fc.externalLibraryDirectories(),
    2249                         fc.externalIncludeDirectories());
     2249                        fc.externalIncludeDirectories(), keepImpLib());
    22502250                ccompiler.compileCCode(ModelicaCompiler.log, ccArgs, outDir);
    22512251                ccompiler.copySharedLibs(outDir, ccArgs.getExternalLibraries());
     
    22572257    private String ModelicaCompiler.cFileName(FClass fc) {
    22582258        return fc.nameUnderscore(); // Hook to facilitate extensions.
     2259    }
     2260   
     2261    private boolean ModelicaCompiler.keepImpLib() {
     2262        return false;
    22592263    }
    22602264
  • branches/dev-mo-2735/Compiler/ModelicaCompiler/src/java/org/jmodelica/util/ccompiler/CCompilerArguments.java

    r13274 r14234  
    2727    private AbstractOptionRegistry options;
    2828    private CCompilerTarget target;
     29    private boolean keepImpLib;
    2930   
    3031    Set<String> externalLibraries;
     
    3435    public CCompilerArguments(String fileName, AbstractOptionRegistry options, CCompilerTarget target,
    3536                              Set<String> externalLibraries, Set<String> externalLibraryDirectories,
    36                               Set<String> externalIncludeDirectories) {
     37                              Set<String> externalIncludeDirectories, boolean keepImpLib) {
    3738       
    3839        this.fileName = fileName;
    3940        this.options = options;
    4041        this.target = target;
     42        this.keepImpLib = keepImpLib;
    4143       
    4244        this.externalLibraries = externalLibraries;
     
    8789        return target.createExtraCFlagsString(options, fileName);
    8890    }
     91   
     92    public String keepImpLib() {
     93        return keepImpLib ? "1" : "0";
     94    }
    8995}
  • branches/dev-mo-2735/Compiler/ModelicaFlatTree/src/jastadd/ConstantEvaluation/ExternalConstantEvaluation.jrag

    r13719 r14234  
    242242       
    243243        CCompilerArguments ccArgs = new CCompilerArguments(source, options, target,
    244                 libs, libDirs, incDirs);
     244                libs, libDirs, incDirs, false);
    245245        executable = ccompiler.compileCCodeLocal(ModelicaCompiler.log, ccArgs, outDir);
    246246        new File(sourceDir, source + ".c").delete();
Note: See TracChangeset for help on using the changeset viewer.