In contrast to the C API, the C++ API did not have symbol visibility
specified. An application using the C++ API would fail to link
against a shared SPIRV-Tools library built with `-fvisibility=hidden`.
Mark all classes in the public `.hpp` files with `SPIRV_TOOLS_EXPORT`.
Add `SPIRV_TOOLS_LOCAL` to hide nested structs containing
implementation details.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This PR is a rebased version of #4479 by James Dong.
---
The primary purpose of this PR is to add the code from my prototype as a PR, for licensing reasons.
The commit history is messy, and the code is not especially clean.
Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/3196.
This PR adds a new executable spirv-lint with a simple "Hello, world!"
program, along with its associated library and a dummy unit test.
For now, only adds to CMake and Bazel; other build systems will be added
in a future PR.
Issue: #3196