Skip to content

Commit

Permalink
Merge #8: Sync to upstream
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fanquake committed Aug 30, 2024
2 parents b60d2b7 + 4a7a05c commit efb8ea0
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 117 deletions.
38 changes: 0 additions & 38 deletions .appveyor.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Copyright 2021 The CRC32C Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. See the AUTHORS file for names of contributors.

name: ci
on: [push, pull_request]

permissions:
contents: read

jobs:
build-and-test:
name: >-
CI
${{ matrix.os }}
${{ matrix.compiler }}
${{ matrix.optimized && 'release' || 'debug' }}
${{ matrix.shared_lib && 'shared' || 'static' }}
${{ matrix.use_glog && 'glog' || 'no-glog' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
compiler: [clang, gcc, msvc]
os: [ubuntu-latest, macos-latest, windows-latest]
optimized: [true, false]
shared_lib: [true, false]
use_glog: [true, false]
exclude:
# Our glog config doesn't work with shared libraries.
- use_glog: true
shared_lib: true
# MSVC only works on Windows.
- os: ubuntu-latest
compiler: msvc
- os: macos-latest
compiler: msvc
# Not testing with GCC on macOS.
- os: macos-latest
compiler: gcc
# Only testing with MSVC on Windows.
- os: windows-latest
compiler: clang
- os: windows-latest
compiler: gcc
# Not testing fringe configurations (glog, shared libraries) on Windows.
- os: windows-latest
use_glog: true
- os: windows-latest
shared_lib: true
include:
- compiler: clang
CC: clang
CXX: clang++
- compiler: gcc
CC: gcc
CXX: g++
- compiler: msvc
CC:
CXX:

env:
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
CMAKE_BUILD_TYPE: ${{ matrix.optimized && 'RelWithDebInfo' || 'Debug' }}
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
BINARY_SUFFIX: ${{ startsWith(matrix.os, 'windows') && '.exe' || '' }}
BINARY_PATH: >-
${{ format(
startsWith(matrix.os, 'windows') && '{0}\build\{1}\' || '{0}/build/',
github.workspace,
matrix.optimized && 'RelWithDebInfo' || 'Debug') }}
steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Generate build config
run: >-
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}"
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
-DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/install_test/
-DBUILD_SHARED_LIBS=${{ matrix.shared_lib && '1' || '0' }}
-DCRC32C_USE_GLOG=${{ matrix.use_glog && '1' || '0' }}
- name: Build
run: >-
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
--config "${{ env.CMAKE_BUILD_TYPE }}"
- name: Run C++ API Tests
run: ${{ env.BINARY_PATH }}crc32c_tests${{ env.BINARY_SUFFIX }}

- name: Run C API Tests
run: ${{ env.BINARY_PATH }}crc32c_capi_tests${{ env.BINARY_SUFFIX }}

- name: Run Benchmarks
run: ${{ env.BINARY_PATH }}crc32c_bench${{ env.BINARY_SUFFIX }}

- name: Test CMake installation
run: cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Editors.
*.sw*
.DS_Store
/.cache
/.vscode

# Build directory.
Expand Down
76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ if(CRC32C_BUILD_TESTS)
# Warnings as errors in Visual Studio for this project's targets.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")

# The Windows SDK version currently on CI produces warnings when some
# headers are #included using C99 compatibility mode or above. This
# workaround can be removed once the Windows SDK on our CI is upgraded.
set_property(TARGET crc32c_capi_tests
APPEND PROPERTY COMPILE_OPTIONS "/wd5105")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")

add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# CRC32C

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

New file format authors should consider
[HighwayHash](https://github.com/google/highwayhash). The initial version of
Expand Down
2 changes: 1 addition & 1 deletion src/crc32c_sse42.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ uint32_t ExtendSse42(uint32_t crc, const uint8_t* data, size_t size) {
}
}

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

0 comments on commit efb8ea0

Please sign in to comment.