瀏覽代碼

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 查看文件

@@ -71,7 +71,8 @@
"c89",
"c99",
"c11",
"c18"
"c18",
"gnu18"
]
},
"cxx_version": {
@@ -83,7 +84,8 @@
"c++11",
"c++14",
"c++17",
"c++20"
"c++20",
"gnu++20"
]
},
"warning_flags": {

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

@@ -323,6 +323,7 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
c99,
c11,
c18,
gnu18,
} c_version_e
= [&] {
if (!c_version) {
@@ -335,6 +336,8 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
return c11;
} else if (c_version == "c18") {
return c18;
} else if (c_version == "gnu18") {
return gnu18;
} else {
fail(context, "Unknown `c_version` ‘{}’", *c_version);
}
@@ -348,6 +351,7 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
cxx14,
cxx17,
cxx20,
gnuxx20,
} cxx_version_e
= [&] {
if (!cxx_version) {
@@ -364,6 +368,8 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
return cxx17;
} else if (cxx_version == "c++20") {
return cxx20;
} else if (cxx_version == "gnu++20") {
return gnuxx20;
} else {
fail(context, "Unknown `cxx_version` ‘{}’", *cxx_version);
}
@@ -380,11 +386,13 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
{{gnu, c99}, {"-std=c99"}},
{{gnu, c11}, {"-std=c11"}},
{{gnu, c18}, {"-std=c18"}},
{{gnu, gnu18}, {"-std=gnu18"}},
{{clang, c_none}, {}},
{{clang, c89}, {"-std=c89"}},
{{clang, c99}, {"-std=c99"}},
{{clang, c11}, {"-std=c11"}},
{{clang, c18}, {"-std=c18"}},
{{clang, gnu18}, {"-std=gnu18"}},
};

auto get_c_version_flags = [&]() -> string_seq {
@@ -411,6 +419,7 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
{{gnu, cxx14}, {"-std=c++14"}},
{{gnu, cxx17}, {"-std=c++17"}},
{{gnu, cxx20}, {"-std=c++20"}},
{{gnu, gnuxx20}, {"-std=gnu++20"}},
{{clang, cxx_none}, {}},
{{clang, cxx98}, {"-std=c++98"}},
{{clang, cxx03}, {"-std=c++03"}},
@@ -418,6 +427,7 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
{{clang, cxx14}, {"-std=c++14"}},
{{clang, cxx17}, {"-std=c++17"}},
{{clang, cxx20}, {"-std=c++20"}},
{{clang, gnuxx20}, {"-std=gnu++20"}},
};

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

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

@@ -231,6 +231,7 @@ std::optional<toolchain> toolchain::get_builtin(std::string_view tc_id) noexcept
CXX_VER_TAG("c++14:", "c++14");
CXX_VER_TAG("c++17:", "c++17");
CXX_VER_TAG("c++20:", "c++20");
CXX_VER_TAG("gnu++20:", "gnu++20");

struct compiler_info {
string c;

Loading…
取消
儲存