@@ -421,6 +421,43 @@ process_option_arg(const Context& ctx,
421421 return Statistic::called_for_preprocessing;
422422 }
423423
424+ if (arg == " -lC" && config.compiler_type () == CompilerType::icc) {
425+ if (i == args.size () - 1 ) {
426+ LOG (" Expected argument after {}" , args[i]);
427+ return Statistic::bad_compiler_arguments;
428+ }
429+
430+ // TODO: should the arg to output the preprocessor output
431+ // be added to the state?
432+
433+ ++i;
434+ return Statistic::none;
435+ }
436+
437+ if (util::starts_with (arg, " --dependencies" )
438+ && config.compiler_type () == CompilerType::icc) {
439+ if (i == args.size () - 1 ) {
440+ LOG (" Expected 1 arguments after {}" , args[i]);
441+ return Statistic::bad_compiler_arguments;
442+ }
443+
444+ state.found_md_or_mmd_opt = true ;
445+ state.found_mf_opt = true ;
446+ args_info.generating_dependencies = true ;
447+ state.add_compiler_only_arg (args[i]);
448+
449+ std::string dep_file{args[i+1 ]};
450+ if (state.output_dep_origin <= OutputDepOrigin::mf) {
451+ state.output_dep_origin = OutputDepOrigin::mf;
452+ args_info.output_dep = core::make_relative_path (ctx, dep_file);
453+ }
454+
455+ state.add_compiler_only_arg (args_info.output_dep );
456+
457+ i++;
458+ return Statistic::none;
459+ }
460+
424461 // Handle "@file" argument.
425462 if (util::starts_with (arg, " @" ) || util::starts_with (arg, " -@" )) {
426463 const char * argpath = arg.c_str () + 1 ;
@@ -710,6 +747,7 @@ process_option_arg(const Context& ctx,
710747 return Statistic::bad_compiler_arguments;
711748 }
712749 args_info.output_obj = args[i + 1 ];
750+ LOG (" Found output: {}" , args_info.output_obj );
713751 i++;
714752 return Statistic::none;
715753 }
@@ -804,6 +842,12 @@ process_option_arg(const Context& ctx,
804842 return Statistic::none;
805843 }
806844
845+ if (arg == " --debug" && config.compiler_type () == CompilerType::icc) {
846+ state.add_common_arg (args[i]);
847+ args_info.generating_debuginfo = true ;
848+ return Statistic::none;
849+ }
850+
807851 if (config.is_compiler_group_msvc () && !config.is_compiler_group_clang ()
808852 && is_msvc_z_debug_option (arg)) {
809853 state.last_seen_msvc_z_debug_option = args[i];
@@ -1369,7 +1413,8 @@ process_args(Context& ctx)
13691413
13701414 const bool is_link =
13711415 !(state.found_c_opt || state.found_dc_opt || state.found_S_opt
1372- || state.found_syntax_only || state.found_analyze_opt );
1416+ || state.found_syntax_only || state.found_analyze_opt
1417+ || config.compiler_type () == CompilerType::icc);
13731418
13741419 if (state.input_files .empty ()) {
13751420 LOG_RAW (" No input file found" );
0 commit comments