diff options
| author | Craig Kolb <craig.kolb@gmail.com> | 2022-05-31 12:04:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 15:04:08 -0400 |
| commit | 393ce4f746c6697442a3a61debd12101fbe4e9db (patch) | |
| tree | 1364d5741490384d23e4aed0b28c013efe0ad51f /source/core/slang-string.cpp | |
| parent | 1a83d50a5d9e85934386310c17a14860cc92e75c (diff) | |
Add Slang::String compatibility with std::ostream (#2256)
* Work around MacOS compilation issue with embed stlib
- The enable-stdlib-generator project is created with
'kind = StaticLib' to allow the build to work, even though
the project doesn't actually create a library.
- Unlike some other platforms, MacOs "ar" emits an error if no
object files are listed to be added to an archive. This causes
enable-stdlib-generator to fail on MacOS.
- Changing the project's kind to "SharedLib" works around the issue.
Other values for kind do not seem to work around the issue.
- Add an optional flag to generatorProject to indicate that
kind = "SharedLibrary" should be used, rather than "StaticLibrary"
- Enable embed stdlib in github_macos_build.sh
* Allow Strings to be used with std::ostream.
Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Diffstat (limited to 'source/core/slang-string.cpp')
| -rw-r--r-- | source/core/slang-string.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/core/slang-string.cpp b/source/core/slang-string.cpp index 1a6221cc8..5f2ba13ba 100644 --- a/source/core/slang-string.cpp +++ b/source/core/slang-string.cpp @@ -690,5 +690,10 @@ namespace Slang return true; } +} +std::ostream& operator<< (std::ostream& stream, const Slang::String& s) +{ + stream << s.getBuffer(); + return stream; } |
