Ejemplo n.º 1
0
void FaustgenFactory::defaultCompileOptions()
{
  fCompileOptions.clear();
  
  // By default when double
  if (sizeof(FAUSTFLOAT) == 8)
    addCompileOption("-double");
  
//   if (fDrawPath != File::nonexistent) {
//     addCompileOption("-svg");
//     addCompileOption("-sn"); //use --simple-names (without arguments) during block-diagram generation
//     addCompileOption("-sd"); //try to further --simplify-diagrams before drawing them
//   }
  
  for (int path=0;path<fLibraryPath.getNumPaths();path++)
    addCompileOption("-I", fLibraryPath[path].getFullPathName());
  
   if (fDrawPath != File::nonexistent)
     addCompileOption("-O", fDrawPath.getFullPathName());
  
  //addCompileOption("-o", "tmp1.cpp");
  
  for (int opt = 0; opt < fExtraOptions.size(); opt++)
  {
    addCompileOption(fExtraOptions.getReference(opt));
  }
  
  // Vector mode by default
  /*
   addCompileOption("-vec");
   addCompileOption("-lv");
   addCompileOption("1");
   */
}
Ejemplo n.º 2
0
bool CppCompiler::compile()
{
    if (abortChecker && abortChecker->abortRequested())
        return false;

    TIME_SECTION(!verbose ? NULL : onlyCompile ? "compile" : "compile/link");

    Owned<IThreadPool> pool = createThreadPool("CCompilerWorker", this, NULL, maxCompileThreads?maxCompileThreads:1, INFINITE);
    addCompileOption(COMPILE_ONLY[targetCompiler]);

    bool ret = false;
    Semaphore finishedCompiling;
    int numSubmitted = 0;
    numFailed.store(0);

    ForEachItemIn(i0, allSources)
    {
        ret = compileFile(pool, allSources.item(i0), finishedCompiling);
        if (!ret)
            break;
        ++numSubmitted;
    }