| 313 | } |
| 314 | |
| 315 | void AddCompileFeature(cmMakefile* makefile, cmTarget* target, |
| 316 | cm::string_view configuration, std::string const& value) |
| 317 | { |
| 318 | auto reLanguageLevel = []() -> cmsys::RegularExpression { |
| 319 | static cmsys::RegularExpression re{ "^[Cc]([+][+])?([0-9][0-9])$" }; |
| 320 | return re; |
| 321 | }(); |
| 322 | |
| 323 | if (reLanguageLevel.find(value)) { |
| 324 | std::string::size_type const n = reLanguageLevel.end() - 2; |
| 325 | cm::string_view const featurePrefix = (n == 3 ? "cxx_std_"_s : "c_std_"_s); |
| 326 | if (configuration.empty()) { |
| 327 | AppendProperty(makefile, target, "COMPILE_FEATURES"_s, {}, |
| 328 | cmStrCat(featurePrefix, value.substr(n))); |
| 329 | } else { |
| 330 | std::string const& feature = |
| 331 | cmStrCat("$<$<CONFIG:"_s, configuration, ">:"_s, featurePrefix, |
| 332 | value.substr(n), '>'); |
| 333 | AppendProperty(makefile, target, "COMPILE_FEATURES"_s, {}, feature); |
| 334 | } |
| 335 | } else if (cmStrCaseEq(value, "gnu"_s)) { |
| 336 | // Not implemented in CMake at this time |
| 337 | } else if (cmStrCaseEq(value, "threads"_s)) { |
| 338 | AppendProperty(makefile, target, "LINK_LIBRARIES"_s, configuration, |
| 339 | "Threads::Threads"); |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | void AddLinkFeature(cmMakefile* makefile, cmTarget* target, |
| 344 | cm::string_view configuration, std::string const& value) |
no test coverage detected
searching dependent graphs…