Skip to content

Commit efb8ea0

Browse files
committed
Merge #8: Sync to upstream
21fc8ef Fix typo (google#59) (Dimitris Apostolou) 89f6984 Fix misspelled "Proccess" in comment (Munkybooty) 02e65f4 Bump deps (google#56) (Victor Costan) b9d6e82 Fix Windows CI build. (google#54) (Victor Costan) bbbb93a Switch CI to GitHub Actions (google#55) (Victor Costan) d46cd17 Add clangd cache directory to .gitignore. (Victor Costan) Pull request description: Pulls the few changes from upstream (last commit ~ 2 years ago). Seems reasonable to do before making any other changes. i.e #7, or if we are going to make further changes to the CMake build system etc. Top commit has no ACKs. Tree-SHA512: ca1cd5a085584d6a4ae65c5d83ae80db7bdd9ab251dc56fa899787dfa0b6fe0a60d32e89b5af5d066fa925a7120f02749aaa854e013f35c442f37a37a30caf23
2 parents b60d2b7 + 4a7a05c commit efb8ea0

File tree

7 files changed

+111
-117
lines changed

7 files changed

+111
-117
lines changed

.appveyor.yml

-38
This file was deleted.

.github/workflows/build.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Copyright 2021 The CRC32C Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file. See the AUTHORS file for names of contributors.
4+
5+
name: ci
6+
on: [push, pull_request]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build-and-test:
13+
name: >-
14+
CI
15+
${{ matrix.os }}
16+
${{ matrix.compiler }}
17+
${{ matrix.optimized && 'release' || 'debug' }}
18+
${{ matrix.shared_lib && 'shared' || 'static' }}
19+
${{ matrix.use_glog && 'glog' || 'no-glog' }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
compiler: [clang, gcc, msvc]
25+
os: [ubuntu-latest, macos-latest, windows-latest]
26+
optimized: [true, false]
27+
shared_lib: [true, false]
28+
use_glog: [true, false]
29+
exclude:
30+
# Our glog config doesn't work with shared libraries.
31+
- use_glog: true
32+
shared_lib: true
33+
# MSVC only works on Windows.
34+
- os: ubuntu-latest
35+
compiler: msvc
36+
- os: macos-latest
37+
compiler: msvc
38+
# Not testing with GCC on macOS.
39+
- os: macos-latest
40+
compiler: gcc
41+
# Only testing with MSVC on Windows.
42+
- os: windows-latest
43+
compiler: clang
44+
- os: windows-latest
45+
compiler: gcc
46+
# Not testing fringe configurations (glog, shared libraries) on Windows.
47+
- os: windows-latest
48+
use_glog: true
49+
- os: windows-latest
50+
shared_lib: true
51+
include:
52+
- compiler: clang
53+
CC: clang
54+
CXX: clang++
55+
- compiler: gcc
56+
CC: gcc
57+
CXX: g++
58+
- compiler: msvc
59+
CC:
60+
CXX:
61+
62+
env:
63+
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
64+
CMAKE_BUILD_TYPE: ${{ matrix.optimized && 'RelWithDebInfo' || 'Debug' }}
65+
CC: ${{ matrix.CC }}
66+
CXX: ${{ matrix.CXX }}
67+
BINARY_SUFFIX: ${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
68+
BINARY_PATH: >-
69+
${{ format(
70+
startsWith(matrix.os, 'windows') && '{0}\build\{1}\' || '{0}/build/',
71+
github.workspace,
72+
matrix.optimized && 'RelWithDebInfo' || 'Debug') }}
73+
74+
steps:
75+
- uses: actions/checkout@v2
76+
with:
77+
submodules: true
78+
79+
- name: Generate build config
80+
run: >-
81+
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}"
82+
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
83+
-DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/install_test/
84+
-DBUILD_SHARED_LIBS=${{ matrix.shared_lib && '1' || '0' }}
85+
-DCRC32C_USE_GLOG=${{ matrix.use_glog && '1' || '0' }}
86+
87+
- name: Build
88+
run: >-
89+
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
90+
--config "${{ env.CMAKE_BUILD_TYPE }}"
91+
92+
- name: Run C++ API Tests
93+
run: ${{ env.BINARY_PATH }}crc32c_tests${{ env.BINARY_SUFFIX }}
94+
95+
- name: Run C API Tests
96+
run: ${{ env.BINARY_PATH }}crc32c_capi_tests${{ env.BINARY_SUFFIX }}
97+
98+
- name: Run Benchmarks
99+
run: ${{ env.BINARY_PATH }}crc32c_bench${{ env.BINARY_SUFFIX }}
100+
101+
- name: Test CMake installation
102+
run: cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Editors.
22
*.sw*
33
.DS_Store
4+
/.cache
45
/.vscode
56

67
# Build directory.

.travis.yml

-76
This file was deleted.

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ if(CRC32C_BUILD_TESTS)
368368
# Warnings as errors in Visual Studio for this project's targets.
369369
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
370370
set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")
371+
372+
# The Windows SDK version currently on CI produces warnings when some
373+
# headers are #included using C99 compatibility mode or above. This
374+
# workaround can be removed once the Windows SDK on our CI is upgraded.
375+
set_property(TARGET crc32c_capi_tests
376+
APPEND PROPERTY COMPILE_OPTIONS "/wd5105")
371377
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
372378

373379
add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# CRC32C
22

3-
[![Build Status](https://travis-ci.org/google/crc32c.svg?branch=master)](https://travis-ci.org/google/crc32c)
4-
[![Build Status](https://ci.appveyor.com/api/projects/status/moiq7331pett4xuj/branch/master?svg=true)](https://ci.appveyor.com/project/pwnall/crc32c)
3+
[![Build Status](https://github.com/google/crc32c/actions/workflows/build.yml/badge.svg)](https://github.com/google/crc32c/actions/workflows/build.yml)
54

65
New file format authors should consider
76
[HighwayHash](https://github.com/google/highwayhash). The initial version of

src/crc32c_sse42.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ uint32_t ExtendSse42(uint32_t crc, const uint8_t* data, size_t size) {
176176
}
177177
}
178178

179-
// Proccess the data in predetermined block sizes with tables for quickly
179+
// Process the data in predetermined block sizes with tables for quickly
180180
// combining the checksum. Experimentally it's better to use larger block
181181
// sizes where possible so use a hierarchy of decreasing block sizes.
182182
uint64_t l64 = l;

0 commit comments

Comments
 (0)