Esempio n. 1
0
 protected List<String> defaultAppendOptions(
     CompileCppOptions options, List<String> command, VirtualFile file) {
   command = BuildUtils.appendAllOptions(command, options.getProjectCompilerOptions());
   command =
       BuildUtils.appendAllOptions(
           command,
           options.getCompilerOptions().replace(MARKER, getEscapedPathToFile(file.getPath())));
   return command;
 }
Esempio n. 2
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);
 }
Esempio n. 3
0
    @Nullable
    List<String> buildCommand(VirtualFile file, CompileCppOptions options) {
      try {
        List<String> commandLine = Arrays.asList("cl.exe");
        if (!options.doRun()) commandLine = BuildUtils.appendOptions(commandLine, "/c");
        else {
          final String fileName = options.getOutputFileName();
          if (fileName != null) {
            commandLine = BuildUtils.appendOptions(commandLine, "/Fe" + fileName);
          }
        }

        commandLine = defaultAppendOptions(options, commandLine, file);
        return BuildUtils.buildVCToolInvokation(commandLine);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
Esempio n. 4
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);
    }