diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-26 13:31:55 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-27 15:31:45 (GMT) |
commit | c797148e8573614a66465cd4ca6ed4bf5e8a5584 (patch) | |
tree | c19c92dc40fa6010c18822468e853773d3392410 /Source/cmQtAutoGen.cxx | |
parent | 8586077baae74c90056704c022aad8357788fa38 (diff) | |
download | CMake-c797148e8573614a66465cd4ca6ed4bf5e8a5584.zip CMake-c797148e8573614a66465cd4ca6ed4bf5e8a5584.tar.gz CMake-c797148e8573614a66465cd4ca6ed4bf5e8a5584.tar.bz2 |
Autogen: Use cm::string_view for AUTO{MOC,UIC,RCC} generator names
- Store `AUTO{MOC,UIC,RCC}` generator name as `cm::string_view`
- Use `std::initializer_list` instead of `std::array`
Diffstat (limited to 'Source/cmQtAutoGen.cxx')
-rw-r--r-- | Source/cmQtAutoGen.cxx | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx index dc7424e..d890f8e 100644 --- a/Source/cmQtAutoGen.cxx +++ b/Source/cmQtAutoGen.cxx @@ -76,44 +76,34 @@ void MergeOptions(std::vector<std::string>& baseOpts, unsigned int const cmQtAutoGen::ParallelMax = 64; std::string const cmQtAutoGen::ListSep = "<<<S>>>"; -std::string const& cmQtAutoGen::GeneratorName(GenT genType) +cm::string_view cmQtAutoGen::GeneratorName(GenT genType) { - static const std::string AutoGen("AutoGen"); - static const std::string AutoMoc("AutoMoc"); - static const std::string AutoUic("AutoUic"); - static const std::string AutoRcc("AutoRcc"); - switch (genType) { case GenT::GEN: - return AutoGen; + return "AutoGen"; case GenT::MOC: - return AutoMoc; + return "AutoMoc"; case GenT::UIC: - return AutoUic; + return "AutoUic"; case GenT::RCC: - return AutoRcc; + return "AutoRcc"; } - return AutoGen; + return "AutoGen"; } -std::string const& cmQtAutoGen::GeneratorNameUpper(GenT genType) +cm::string_view cmQtAutoGen::GeneratorNameUpper(GenT genType) { - static const std::string AUTOGEN("AUTOGEN"); - static const std::string AUTOMOC("AUTOMOC"); - static const std::string AUTOUIC("AUTOUIC"); - static const std::string AUTORCC("AUTORCC"); - switch (genType) { case GenT::GEN: - return AUTOGEN; + return "AUTOGEN"; case GenT::MOC: - return AUTOMOC; + return "AUTOMOC"; case GenT::UIC: - return AUTOUIC; + return "AUTOUIC"; case GenT::RCC: - return AUTORCC; + return "AUTORCC"; } - return AUTOGEN; + return "AUTOGEN"; } std::string cmQtAutoGen::Tools(bool moc, bool uic, bool rcc) |