瀏覽代碼

add gnu18 and gnuxx20 version variants

default_compile_flags
John Robinson 3 年之前
父節點
當前提交
03eb98bcf9
沒有發現已知的金鑰在資料庫的簽署中
共有 3 個文件被更改,包括 15 次插入2 次删除
  1. +4
    -2
      res/toolchain-schema.json
  2. +10
    -0
      src/dds/toolchain/from_json.cpp
  3. +1
    -0
      src/dds/toolchain/toolchain.cpp

+ 4
- 2
res/toolchain-schema.json 查看文件

"c89", "c89",
"c99", "c99",
"c11", "c11",
"c18"
"c18",
"gnu18"
] ]
}, },
"cxx_version": { "cxx_version": {
"c++11", "c++11",
"c++14", "c++14",
"c++17", "c++17",
"c++20"
"c++20",
"gnu++20"
] ]
}, },
"warning_flags": { "warning_flags": {

+ 10
- 0
src/dds/toolchain/from_json.cpp 查看文件

c99, c99,
c11, c11,
c18, c18,
gnu18,
} c_version_e } c_version_e
= [&] { = [&] {
if (!c_version) { if (!c_version) {
return c11; return c11;
} else if (c_version == "c18") { } else if (c_version == "c18") {
return c18; return c18;
} else if (c_version == "gnu18") {
return gnu18;
} else { } else {
fail(context, "Unknown `c_version` ‘{}’", *c_version); fail(context, "Unknown `c_version` ‘{}’", *c_version);
} }
cxx14, cxx14,
cxx17, cxx17,
cxx20, cxx20,
gnuxx20,
} cxx_version_e } cxx_version_e
= [&] { = [&] {
if (!cxx_version) { if (!cxx_version) {
return cxx17; return cxx17;
} else if (cxx_version == "c++20") { } else if (cxx_version == "c++20") {
return cxx20; return cxx20;
} else if (cxx_version == "gnu++20") {
return gnuxx20;
} else { } else {
fail(context, "Unknown `cxx_version` ‘{}’", *cxx_version); fail(context, "Unknown `cxx_version` ‘{}’", *cxx_version);
} }
{{gnu, c99}, {"-std=c99"}}, {{gnu, c99}, {"-std=c99"}},
{{gnu, c11}, {"-std=c11"}}, {{gnu, c11}, {"-std=c11"}},
{{gnu, c18}, {"-std=c18"}}, {{gnu, c18}, {"-std=c18"}},
{{gnu, gnu18}, {"-std=gnu18"}},
{{clang, c_none}, {}}, {{clang, c_none}, {}},
{{clang, c89}, {"-std=c89"}}, {{clang, c89}, {"-std=c89"}},
{{clang, c99}, {"-std=c99"}}, {{clang, c99}, {"-std=c99"}},
{{clang, c11}, {"-std=c11"}}, {{clang, c11}, {"-std=c11"}},
{{clang, c18}, {"-std=c18"}}, {{clang, c18}, {"-std=c18"}},
{{clang, gnu18}, {"-std=gnu18"}},
}; };


auto get_c_version_flags = [&]() -> string_seq { auto get_c_version_flags = [&]() -> string_seq {
{{gnu, cxx14}, {"-std=c++14"}}, {{gnu, cxx14}, {"-std=c++14"}},
{{gnu, cxx17}, {"-std=c++17"}}, {{gnu, cxx17}, {"-std=c++17"}},
{{gnu, cxx20}, {"-std=c++20"}}, {{gnu, cxx20}, {"-std=c++20"}},
{{gnu, gnuxx20}, {"-std=gnu++20"}},
{{clang, cxx_none}, {}}, {{clang, cxx_none}, {}},
{{clang, cxx98}, {"-std=c++98"}}, {{clang, cxx98}, {"-std=c++98"}},
{{clang, cxx03}, {"-std=c++03"}}, {{clang, cxx03}, {"-std=c++03"}},
{{clang, cxx14}, {"-std=c++14"}}, {{clang, cxx14}, {"-std=c++14"}},
{{clang, cxx17}, {"-std=c++17"}}, {{clang, cxx17}, {"-std=c++17"}},
{{clang, cxx20}, {"-std=c++20"}}, {{clang, cxx20}, {"-std=c++20"}},
{{clang, gnuxx20}, {"-std=gnu++20"}},
}; };


auto get_cxx_version_flags = [&]() -> string_seq { auto get_cxx_version_flags = [&]() -> string_seq {

+ 1
- 0
src/dds/toolchain/toolchain.cpp 查看文件

CXX_VER_TAG("c++14:", "c++14"); CXX_VER_TAG("c++14:", "c++14");
CXX_VER_TAG("c++17:", "c++17"); CXX_VER_TAG("c++17:", "c++17");
CXX_VER_TAG("c++20:", "c++20"); CXX_VER_TAG("c++20:", "c++20");
CXX_VER_TAG("gnu++20:", "gnu++20");


struct compiler_info { struct compiler_info {
string c; string c;

Loading…
取消
儲存