Commit Graph

16 Commits

Author SHA1 Message Date
John Cater
54691dcd73
Migrate exec_tools back to tools. (#5280)
The host transition migration is done so these can now be moved back and
`exec_tools` can be removed.
2023-06-21 15:32:27 -04:00
Nathan Gauër
d8759a140b
build: fix bazel build for c++17 (#5097)
This commit changes the way bazel chooses which version to build.
Before, we had a COPT set to -std=c++17, which is analogous to the cmake
way.
However, googletest decided to follow abseil, meaning this is *not*
recommended at all, and causes a mixed-standard build.

From https://github.com/abseil/abseil-cpp/blob/master/FAQ.md#how-to-i-set-the-c-dialect-used-to-build-abseil
we have 3 options to define the standard. Using a bazelrc is what I
believe to be the simplest, as it "fixes" the repo standard.

Signed-off-by: Nathan Gauër <brioche@google.com>
2023-02-02 14:05:02 +00:00
David Neto
f416d39bb8
Bazel: Use @platforms//os:windows instead of @build_tools//src/conditions:windows (#5042)
Bazel has been changing its conventions for implementing
conditions on target OS. Update to the latest recommendation.
See https://bazel.build/extending/platforms

Silences a deprecation warning.

Fixes: #5037
2022-12-22 08:13:40 -05:00
Rafael Marinheiro
c5d2316430
Enforce layering_check in Bazel build rules. (#5032)
* Enforce layering_check in Bazel build rules.

Enforcing layering_check ensures that the Build targets do not rely on
transitive dependencies. See
https://github.com/bazelbuild/bazel/pull/11440 for a detailed
description of the feature.

We also do a style pass on the build files, ensuring that common linters
are happy with it.

* Add .bazelversion file and fix build_defs.bzl.

We fix build_defs.bzl to work on Bazel 5.0.0.
2022-12-20 10:54:46 -05:00
alan-baker
d35a78db57
Switch SPIRV-Tools to use spirv.hpp11 internally (#4981)
Fixes #4960

* Switches to using enum classes with an underlying type to avoid
  undefined behaviour
2022-11-04 17:27:10 -04:00
Kevin Lubick
6803cc5126
use exec_tools instead of tools for better RBE compatibility (#4837) 2022-07-05 13:54:59 -04:00
IcyTv
98dce6ca18
Fixed Bazel Windows build (#4736)
* Fixed Bazel Windows build

Before this commit, the bazel build setup would not work on windows.
This is due to the fact, that genrule tries to use bash, which fails.
One fix would be to use bazel-skylib's run_binary.
This however does not work (easily) since genrules is more complex.

To (temporarily) fix the windows build, I added the `cmd_bat` property to every genrule.
This seems more like a hack, because it basically repeat commands,
 but for now it at least builds on windows.

* Removed BAZEL_SH from bazel presubmit build script

Thanks to @s-perron for pointing out, that the presubmit script uses the msys64 bash shell for the bazel build.
Since adding the `cmd_bat` argument removes the dependency on bash, this is no longer needed.
2022-03-07 12:50:19 -05:00
Greg Fischer
1454c95d1b
spirv-opt: Switch from Vulkan.DebugInfo to Shader.DebugInfo (#4493)
Includes:
- Shift to use of spirv-header extinst.nonsemantic.shader grammar.json
- Remove extinst.nonsemantic.vulkan.debuginfo.100.grammar.json
- Enable all optimizations for Shader.DebugInfo

Also fixes scalar replacement to only insert DebugValue after all
OpVariables. This is not necessary for OpenCL.DebugInfo, but it is
for Shader.DebugInfo.

Likewise, fixes Private-to-Local to insert DebugDeclare after all
OpVariables.

Also fixes inlining to handle FunctionDefinition which can show up
after first block if early return processing happens.

Co-authored-by: baldurk <baldurk@baldurk.org>
2021-09-15 14:38:53 -04:00
dong-ja
706dc27a62
Add new target for spirv-lint (#4446)
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
2021-08-06 14:03:59 -04:00
Greg Fischer
3b6abf41cc
Add non-semantic vulkan extended instruction set (#4362)
This is based on a legacy commit which installs a local grammar. A
followup commit will change to the grammar in SPIRV-Headers.

Co-authored-by: baldurk <baldurk@baldurk.org>
2021-07-12 05:51:08 -04:00
alan-baker
50300450af
Validator support for non-semantic clspv reflection (#3618)
* Generate ext inst table for reflection
* Change build to use grammar files from SPIRV-Headers instead of
  SPIRV-Tools
* Add enum for clspv reflection extended instruction set
  * count it as non-semantic
* validate clspv reflection extended instruction set
* Remove local extended inst sets
* update headers deps
* Update nbuilds to use grammars from SPIRV-Headers instead of
  local duplicates
2020-07-30 12:08:53 -04:00
Geoff Lang
fb6e3e48d5
Combine extinst-name and extinst-output-base into one arg. (#3200)
* Combine the extinst-name and extinst-output-base into one arg.

Some build systems such as Android blueprints require that the inputs
and outputs of generator scripts are all provided as arguments.  These
two arguments to generate_language_headers.py are combined to form the
output path in the script.  This change simply lets the user provide the
whole output path as an argument.

* Fix typo in build_defs.bzl and update Android.mk
2020-02-25 00:46:52 -05:00
David Neto
64f36ea529
Support OpenCL.DebugInfo.100 extended instruction set (#3080)
* Clone opencl.debuginfo.100 grammar from debuginfo grammar

Update version number to 200 revision 2

* Apply content from OpenCL.DebugInfo.100 extension text

* Rename grammar file

* Support OpenCL.DebugInfo.100 extended instructions

Add support for prefixing operand type names, to disambiguate
them between different instruction sets.

* Add tests for OpenCL.DebugInfo.100

* Support lookup of OpenCL.DebugInfo.100 extinst

* Add tests for enum values

* Recognize 2017-2019 as copyright date range

* Android.mk: support OpenCL.DebugInfo.100 extended instruction set

Also, stop generating core instruction tables for non-unified1 versions
of the grammar.

* Imported entity operand type is concrete

* Bazel: Suppoort OpenCL.DebugInfo.100

* BUILD.gn: Support OpenCL.DebugInfo.100
2019-12-19 17:16:26 -05:00
Ehsan
82f84c4b8f
Use a longer timeout for Bazel tests. (#2956) 2019-10-09 15:14:42 -05:00
Ehsan
bc84daff22 Add Kokoro bots for building with Bazel. (#2914)
Add Kokoro bots for building with Bazel.
2019-09-27 09:13:32 -04:00
Ehsan
a03cd1f3eb
Add Bazel build configuration. (#2891)
* Add Bazel build configuration.

* fix for windows.

* Update doc file.

* Add tests that were accidentally skipped by Bazel

* Update doc file.
2019-09-24 15:56:59 -04:00