예제 #1
0
 @Nullable
 List<String> buildCommand(VirtualFile file, CompileCppOptions options) {
   List<String> commandLine = new ArrayList<String>(4);
   if (!options.doRun()) {
     commandLine = BuildUtils.appendOptions(commandLine, "-S");
   } else {
     final String fileName = options.getOutputFileName();
     if (fileName != null) {
       commandLine = BuildUtils.appendOptions(commandLine, "-o");
       commandLine = BuildUtils.appendOptions(commandLine, fileName);
     }
   }
   commandLine = defaultAppendOptions(options, commandLine, file);
   myItems = BuildUtils.buildEnvironmentMap(options.getProject(), file);
   return BuildUtils.buildClangToolCall(
       CppSupportSettings.getInstance().getClangPath(), commandLine);
 }
예제 #2
0
    @Nullable
    List<String> buildCommand(VirtualFile file, CompileCppOptions options) {
      List<String> command = new ArrayList<String>(4);
      if (!options.doRun()) command = BuildUtils.appendOptions(command, "-c");
      else {
        final String fileName = options.getOutputFileName();
        if (fileName != null) {
          command = BuildUtils.appendOptions(command, "-o");
          command = BuildUtils.appendOptions(command, fileName);
        }
      }
      command = defaultAppendOptions(options, command, file);
      myItems = BuildUtils.buildEnvironmentMap(options.getProject(), file);
      String gccPath =
          CppSupportSettings.getInstance()
              .getGccPath()
              .replaceAll("gcc", options.isCppFile() ? "g++" : "gcc");

      return BuildUtils.buildGccToolCall(gccPath, command);
    }