File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ bool GccCpp2ObjAction::execute(const DepInfo& info)
3434
3535 string cmd = compile_cpp_cmd;
3636
37- cmd += compiler_specific_extra_compile_flags[cpp_path];
37+ cmd += compiler_specific_extra_compile_flags[cpp_path. string () ];
3838
3939 cmd += " " ;
4040 cmd += compile_cmd_include_dirs;
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ bool VcCpp2ObjAction::execute(const DepInfo& info)
3838 string cmd = R"( ")" ; // cmd的怪癖,传给system函数的东西,前后还得一个引号。 参考: https://stackoverflow.com/questions/9964865/c-system-not-working-when-there-are-spaces-in-two-different-parameters
3939 cmd += compile_cpp_cmd;
4040
41- cmd += compiler_specific_extra_compile_flags[cpp_path];
41+ cmd += compiler_specific_extra_compile_flags[cpp_path. string () ];
4242
4343 cmd += " " ;
4444 cmd += compile_cmd_include_dirs;
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ bool vc_use_pch = false; // vc是否使用预编译头文件。(目前只支持
6565fs::path vc_h_to_precompile; // vc需要预编译的头文件。等于headers_to_pc[0]
6666fs::path vc_cpp_to_generate_pch; // vc用于产生预编译头文件的cpp文件
6767// string compiler_specific_extra_compile_flags; // 源文件中指定的,编译时用的其他选项
68- map<fs::path, string> compiler_specific_extra_compile_flags; // 源文件中指定的,编译时用的其他选项。不同文件可能用不同的编译选项
68+ // unordered_map<fs::path, string> compiler_specific_extra_compile_flags; // 源文件中指定的,编译时用的其他选项。不同文件可能用不同的编译选项
69+ unordered_map<string, string> compiler_specific_extra_compile_flags; // 源文件中指定的,编译时用的其他选项。不同文件可能用不同的编译选项
6970string compiler_specific_extra_link_flags; // 源文件中指定的,链接时用的其他选项
7071
7172
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ extern bool vc_use_pch;
2727extern fs ::path vc_h_to_precompile ;
2828extern fs ::path vc_cpp_to_generate_pch ;
2929//extern string compiler_specific_extra_compile_flags;
30- extern map < fs ::path , string > compiler_specific_extra_compile_flags ;
30+ //extern unordered_map<fs::path, string> compiler_specific_extra_compile_flags;
31+ extern unordered_map < string , string > compiler_specific_extra_compile_flags ;
3132extern string compiler_specific_extra_link_flags ;
3233extern string compiler_dir ;
3334extern string compile_cmd_include_dirs ;
Original file line number Diff line number Diff line change 1111 collect ();
1212 if (collect_only) return 0 ;
1313
14- // todo: 额外的flags,是各个.cpp文件独立设置?还是?独立设置吧
15- // compile_cpp_cmd += compiler_specific_extra_compile_flags;
16- // compile_h_cmd += compiler_specific_extra_compile_flags;
17-
1814 // 构建
1915 bool success = build ();
2016 if (!success) return 0 ;
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ void scan(fs::path src_path)
100100 MINILOG (collect_info_logger, " found extra link flags: " << matches[1 ]);
101101 string flags = " " ;
102102 flags += matches[1 ];
103- compiler_specific_extra_compile_flags[src_path] += flags;
103+ compiler_specific_extra_compile_flags[src_path. string () ] += flags;
104104 }
105105
106106 if (regex_search (line, matches, compiler_specific_extra_link_flags_pat)) {
You can’t perform that action at this time.
0 commit comments