Kaynağa Gözat

add gnu18 and gnuxx20 version variants

gnu_extensions
John Robinson 3 yıl önce
ebeveyn
işleme
a136901167
Veri tabanında bu imza için bilinen anahtar bulunamadı
3 değiştirilmiş dosya ile 15 ekleme ve 2 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -320,6 +320,7 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
c99,
c11,
c18,
gnu18,
} c_version_e
= [&] {
if (!c_version) {
@@ -332,6 +333,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);
}
@@ -345,6 +348,7 @@ toolchain dds::parse_toolchain_json_data(const json5::data& dat, std::string_vie
cxx14,
cxx17,
cxx20,
gnuxx20,
} cxx_version_e
= [&] {
if (!cxx_version) {
@@ -361,6 +365,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);
}
@@ -377,11 +383,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 {
@@ -408,6 +416,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"}},
@@ -415,6 +424,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 Dosyayı Görüntüle

@@ -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;

Yükleniyor…
İptal
Kaydet