diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-13 19:56:35 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2023-01-13 22:32:09 +0100 |
commit | 916060cb53fddb94f64b20d3616e7360c5e91f64 (patch) | |
tree | 4a2bcef4672b5e04b106f88cca3bec631b214c00 /src/configure.cc | |
parent | c093758b4688fb5bae2cc7727b6c9b52b824043e (diff) |
Capture flags in a class instead of a string and add conversion functions between them.
Diffstat (limited to 'src/configure.cc')
-rw-r--r-- | src/configure.cc | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/src/configure.cc b/src/configure.cc index deeb6a6..34812fa 100644 --- a/src/configure.cc +++ b/src/configure.cc @@ -191,6 +191,42 @@ std::ostream& operator<<(std::ostream& stream, const ctor::toolchain& toolchain) } return stream; } + +std::ostream& operator<<(std::ostream& ostr, const ctor::c_flag& flag) +{ + for(const auto& s : to_strings(ctor::toolchain::any, flag)) + { + ostr << s; + } + return ostr; +} + +std::ostream& operator<<(std::ostream& ostr, const ctor::cxx_flag& flag) +{ + for(const auto& s : to_strings(ctor::toolchain::any, flag)) + { + ostr << s; + } + return ostr; +} + +std::ostream& operator<<(std::ostream& ostr, const ctor::ld_flag& flag) +{ + for(const auto& s : to_strings(ctor::toolchain::any, flag)) + { + ostr << s; + } + return ostr; +} + +std::ostream& operator<<(std::ostream& ostr, const ctor::asm_flag& flag) +{ + for(const auto& s : to_strings(ctor::toolchain::any, flag)) + { + ostr << s; + } + return ostr; +} } // helper constant for the visitor @@ -521,7 +557,7 @@ int regenerateCache(ctor::settings& settings, istr << " .cxxflags = {"; for(const auto& flag : resolved_flags.cxxflags) { - istr << "\"" << flag << "\","; + istr << flag << ","; } istr << "},\n"; } @@ -531,7 +567,7 @@ int regenerateCache(ctor::settings& settings, istr << " .cflags = {"; for(const auto& flag : resolved_flags.cflags) { - istr << "\"" << flag << "\","; + istr << flag << ","; } istr << "},\n"; } @@ -541,7 +577,7 @@ int regenerateCache(ctor::settings& settings, istr << " .ldflags = {"; for(const auto& flag : resolved_flags.ldflags) { - istr << "\"" << flag << "\","; + istr << flag << ","; } istr << "},\n"; } @@ -551,7 +587,7 @@ int regenerateCache(ctor::settings& settings, istr << " .asmflags = {"; for(const auto& flag : resolved_flags.asmflags) { - istr << "\"" << flag << "\","; + istr << flag << ","; } istr << "},\n"; } |