Skip to content

Commit

Permalink
Try to fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
eustas committed Mar 13, 2024
1 parent 491a740 commit acf941d
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 206 deletions.
221 changes: 15 additions & 206 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,228 +17,37 @@ name: Build / test
on: [push, pull_request]
jobs:
cmake:
name: Build and test ${{ matrix.name }}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- name: Clang-6.0
extra_deps: clang-6.0
c_compiler: clang-6.0
cxx_compiler: clang++-6.0
cxx_standard: 11

- name: Clang-6.0 (C++14)
extra_deps: clang-6.0
c_compiler: clang-6.0
cxx_compiler: clang++-6.0
cxx_standard: 14

- name: Clang-6.0 (C++17)
extra_deps: clang-6.0
c_compiler: clang-6.0
cxx_compiler: clang++-6.0
cxx_standard: 17

- name: Clang-7
extra_deps: clang-7
c_compiler: clang-7
cxx_compiler: clang++-7
cxx_standard: 11

- name: Clang-7 (C++14)
extra_deps: clang-7
c_compiler: clang-7
cxx_compiler: clang++-7
cxx_standard: 14

- name: Clang-7 (C++17)
extra_deps: clang-7
c_compiler: clang-7
cxx_compiler: clang++-7
cxx_standard: 17

- name: Clang-8
extra_deps: clang-8
c_compiler: clang-8
cxx_compiler: clang++-8
cxx_standard: 11

- name: Clang-9
extra_deps: clang-9
c_compiler: clang-9
cxx_compiler: clang++-9
cxx_standard: 11

- name: Clang-10
extra_deps: clang-10
c_compiler: clang-10
cxx_compiler: clang++-10
cxx_standard: 11

- name: Clang-10 (C++20)
extra_deps: clang-10
c_compiler: clang-10
cxx_compiler: clang++-10
cxx_standard: 20

- name: Clang-11
extra_deps: clang-11
c_compiler: clang-11
cxx_compiler: clang++-11
cxx_standard: 11

- name: Clang-12
extra_deps: clang-12
c_compiler: clang-12
cxx_compiler: clang++-12
cxx_standard: 11

- name: GCC-8
extra_deps: g++-8
c_compiler: gcc-8
cxx_compiler: g++-8
cxx_flags: -ftrapv
cxx_standard: 11

- name: GCC-8 (C++14)
extra_deps: g++-8
c_compiler: gcc-8
cxx_compiler: g++-8
cxx_flags: -ftrapv
cxx_standard: 14

- name: GCC-8 (C++17)
extra_deps: g++-8
c_compiler: gcc-8
cxx_compiler: g++-8
cxx_flags: -ftrapv
cxx_standard: 17

- name: GCC-9
extra_deps: g++-9
c_compiler: gcc-9
cxx_compiler: g++-9
cxx_flags: -ftrapv
cxx_standard: 11

- name: GCC-10
extra_deps: g++-10
c_compiler: gcc-10
cxx_compiler: g++-10
cxx_flags: -ftrapv
cxx_standard: 11
if: false
runs-on: windows-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit # cannot be block - runner does git checkout

- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0

- name: Install deps
run: sudo apt-get install ${{ matrix.extra_deps }}

- name: Build and test
shell: bash
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=2
export CTEST_PARALLEL_LEVEL=2
CXXFLAGS=${{ matrix.cxx_flags }} CC=${{ matrix.c_compiler }} CXX=${{ matrix.cxx_compiler }} cmake -DHWY_WARNINGS_ARE_ERRORS=ON -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -B out .
cmake CC=clang CXX=clang++ cmake -DHWY_WARNINGS_ARE_ERRORS=ON -DCMAKE_CXX_STANDARD=11 -B out .
cmake --build out
ctest --test-dir out
cmake_ubuntu_2204:
name: Build and test ${{ matrix.name }}
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- name: Clang-13
extra_deps: clang-13
c_compiler: clang-13
cxx_compiler: clang++-13
cxx_standard: 11

- name: Clang-14
extra_deps: clang-14
c_compiler: clang-14
cxx_compiler: clang++-14
cxx_standard: 11

- name: Clang-15
extra_deps: clang-15
c_compiler: clang-15
cxx_compiler: clang++-15
cxx_standard: 11

- name: Clang-15 (C++20)
extra_deps: clang-15
c_compiler: clang-15
cxx_compiler: clang++-15
cxx_standard: 20

- name: GCC-11
extra_deps: g++-11
c_compiler: gcc-11
cxx_compiler: g++-11
cxx_flags: -ftrapv
cxx_standard: 11

- name: GCC-11 (C++20)
extra_deps: g++-11
c_compiler: gcc-11
cxx_compiler: g++-11
cxx_flags: -ftrapv
cxx_standard: 20

- name: GCC-12
extra_deps: g++-12
c_compiler: gcc-12
cxx_compiler: g++-12
cxx_flags: -ftrapv
cxx_standard: 11

- name: GCC-12 (C++20)
extra_deps: g++-12
c_compiler: gcc-12
cxx_compiler: g++-12
cxx_flags: -ftrapv
cxx_standard: 20
bazel:
runs-on: windows-latest

steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit # cannot be block - runner does git checkout

- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0

- name: Install deps
run: sudo apt-get install ${{ matrix.extra_deps }}
- uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3.0.0

- name: Build and test
- name: build
shell: bash
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=2
export CTEST_PARALLEL_LEVEL=2
CXXFLAGS=${{ matrix.cxx_flags }} CC=${{ matrix.c_compiler }} CXX=${{ matrix.cxx_compiler }} cmake -DHWY_WARNINGS_ARE_ERRORS=ON -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -B out .
cmake --build out
ctest --test-dir out
bazel build :all
bazel:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit # cannot be block - runner does git checkout

- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0

- uses: bazelbuild/setup-bazelisk@b39c379c82683a5f25d34f0d062761f62693e0b2 # v3.0.0
- name: test
shell: bash
run: bazel test :all

- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: ~/.cache/bazel
key: bazel-${{ runner.os }}
- run: bazel build //...

1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ permissions: {}

jobs:
analyze:
if: false
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs_pages_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:
jobs:

build_docs_job:
if: false
runs-on: ubuntu-latest
container: debian:buster-slim

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ permissions:

jobs:
multiarch:
if: false
runs-on: ubuntu-22.04
strategy:
fail-fast: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ docs/g3doc/*
docs/html/*
docs/md/*
docs/rst/*
/bazel*
5 changes: 5 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ cc_binary(
":hwy",
":nanobenchmark",
],
linkstatic = False,
)

cc_library(
Expand All @@ -433,6 +434,10 @@ cc_test(
size = "small",
srcs = ["hwy/tests/list_targets.cc"],
deps = [":hwy"],
linkstatic = select({
"@platforms//cpu:riscv64": True,
"//conditions:default": False,
}),
)

# path, name
Expand Down
16 changes: 16 additions & 0 deletions hwy/contrib/sort/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ cc_binary(
":vqsort",
"//:hwy",
],
linkstatic = select({
"@platforms//cpu:riscv64": True,
"//conditions:default": False,
}),
)

cc_test(
Expand All @@ -206,6 +210,10 @@ cc_test(
"//:hwy",
"//:hwy_test_util",
],
linkstatic = select({
"@platforms//cpu:riscv64": True,
"//conditions:default": False,
}),
)

cc_test(
Expand All @@ -224,6 +232,10 @@ cc_test(
"//:hwy_test_util",
"//:nanobenchmark",
],
linkstatic = select({
"@platforms//cpu:riscv64": True,
"//conditions:default": False,
}),
)

cc_binary(
Expand All @@ -239,4 +251,8 @@ cc_binary(
"//:hwy",
"//:hwy_test_util",
],
linkstatic = select({
"@platforms//cpu:riscv64": True,
"//conditions:default": False,
}),
)
2 changes: 2 additions & 0 deletions hwy/highway_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
#define HWY_DLLEXPORT_H

#if !defined(HWY_SHARED_DEFINE)

#define HWY_DLLEXPORT
#define HWY_CONTRIB_DLLEXPORT
#define HWY_TEST_DLLEXPORT

#else // !HWY_SHARED_DEFINE

#ifndef HWY_DLLEXPORT
Expand Down

0 comments on commit acf941d

Please sign in to comment.