Skip to content

Commit

Permalink
Run CI on Windows
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 651462679
  • Loading branch information
sfreilich authored and copybara-github committed Jul 11, 2024
1 parent c344295 commit cc99f88
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
build --repo_env=CC=clang
build --repo_env=CXX=clang++

# Set up to use C++20.
build --cxxopt='-std=c++20'
build --copt=-mcrc32
build --cxxopt=-std=c++20

# Enable Bzlmod for every Bazel command
common --enable_bzlmod
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/bazel-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ jobs:
bazel_test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up Clang
if: runner.os == 'Windows'
uses: egor-tensin/setup-clang@v1

- name: Test
run: bazel test --test_output=errors //...
6 changes: 5 additions & 1 deletion .github/workflows/cmake-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
cmake_test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

Expand All @@ -18,6 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Clang
if: runner.os == 'Windows'
uses: egor-tensin/setup-clang@v1

- name: Configure CMake
run: cmake .

Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
cmake_minimum_required(VERSION 3.19)
Project(InkStrokeModeler VERSION 0.1.0 LANGUAGES CXX)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++20 -mcrc32")

if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
option(INK_STROKE_MODELER_BUILD_TESTING "Build tests and testonly libraries" ON)
option(INK_STROKE_MODELER_ENABLE_INSTALL "Enable install rule" ON)
else()
Expand Down

0 comments on commit cc99f88

Please sign in to comment.