Add c++ version to .bazelrc (#5247)

I finally found out how to add platform specific options to the bazelrc
file. I will use that to add the c++ language level to the bazelrc flie.
This commit is contained in:
Steven Perron 2023-05-30 09:29:04 -04:00 committed by GitHub
parent cf62673e42
commit 8841d560c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 12 deletions

4
.bazelrc Normal file
View File

@ -0,0 +1,4 @@
build --enable_platform_specific_config
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
build:windows --cxxopt=/std:c++17

View File

@ -30,13 +30,13 @@ jobs:
key: bazel-cache-${{ runner.os }} key: bazel-cache-${{ runner.os }}
- name: Build All (Windows) - name: Build All (Windows)
if: ${{matrix.os == 'windows-latest' }} if: ${{matrix.os == 'windows-latest' }}
run: bazel --output_user_root=~/.bazel/cache build --cxxopt=/std:c++17 //... run: bazel --output_user_root=~/.bazel/cache build //...
- name: Test All (Windows) - name: Test All (Windows)
if: ${{matrix.os == 'windows-latest' }} if: ${{matrix.os == 'windows-latest' }}
run: bazel --output_user_root=~/.bazel/cache test --cxxopt=/std:c++17 //... run: bazel --output_user_root=~/.bazel/cache test //...
- name: Build All (Linux, MacOS) - name: Build All (Linux, MacOS)
if: ${{ matrix.os != 'windows-latest' }} if: ${{ matrix.os != 'windows-latest' }}
run: bazel --output_user_root=~/.bazel/cache build --cxxopt=-std=c++17 //... run: bazel --output_user_root=~/.bazel/cache build //...
- name: Test All (Linux, MacOS) - name: Test All (Linux, MacOS)
if: ${{ matrix.os != 'windows-latest' }} if: ${{ matrix.os != 'windows-latest' }}
run: bazel --output_user_root=~/.bazel/cache test --cxxopt=-std=c++17 //... run: bazel --output_user_root=~/.bazel/cache test //...

View File

@ -386,15 +386,8 @@ fuzzer tests.
### Build using Bazel ### Build using Bazel
You can also use [Bazel](https://bazel.build/) to build the project. You can also use [Bazel](https://bazel.build/) to build the project.
On linux:
```sh ```sh
cd <spirv-dir> bazel build :all
bazel build --cxxopt=-std=c++17 :all
```
On windows:
```sh
bazel build --cxxopt=/std:c++17 :all
``` ```
### Build a node.js package using Emscripten ### Build a node.js package using Emscripten