Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
BatchDrake committed Jul 5, 2022
2 parents eb64365 + b62ac48 commit 1d7559d
Show file tree
Hide file tree
Showing 124 changed files with 6,993 additions and 8,829 deletions.
103 changes: 103 additions & 0 deletions .clang-format
@@ -0,0 +1,103 @@
---
BasedOnStyle: Google
---
Language: Cpp

# 1. Two space indentation (never-ever use tabs)
IndentWidth: 2
UseTab: Never

# 2. Max number of columns is 80
ColumnLimit: 80

# 3. No space before parenthesis except for flow control statements
# (if, for, switch, etc) and sizeof.
# Warning: It seems there is no option for spacing after sizeof
SpaceBeforeCaseColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true

# 4. Opening and closing braces in the same line as the statement they refer to,
# preceded by a space (if () {) except for function definitions
# (opening braces in a new line)
BreakBeforeBraces: Linux

# 5. Variable declarations at the beginning of the innermost block they are
# required.
# Warn: Cannot be tested

# 6. Return type and qualifiers of a function prototype goes in the same line
# as the function name.
# 7. Return type and qualifiers of a function definition goes in two separate
# lines (qualifiers, types, line break, name(...))
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: AllDefinitions

# 8. If a line is too long (more than 80 chars) we break it according to the
# following rules:
# - We break from left to right, until all sublines honor the 80 column limit
# - Line break increments the indentation level of all sublines in one unit
# (2 spaces) except the first one
# - Unary operations are never broken
# - Binary operations are broken between the first operand and the operation
# - Ternary operations are broken in three lines, with the first break
# between the conditional expression and the "?", and the second break
# right before the ":"
# - Function calls are broken right after the parenthesis, with every
# argument in a separate line except if the grouping of certain arguments
# improves readability (e.g. pairs of I/Q components, groups of 3 spatial
# coordinates, etc)
# - Function definitions are broken right after the parenthesis, with every
# argument definition in a separate line, always.
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
AllowAllArgumentsOnNextLine: false
BinPackArguments: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackParameters: false

# 9. Assignments inside conditional statements are allowed, unless it impacts
# readability
# Warn: Cannot be tested

# 10. Braceless blocks (i.e. when the body of certain control flow statement
# consists in only one statement) are preferred, according to the following
# rules:
# - The statement itself and its body is separated by a line break, with the
# body indentation incremented by one unit.
# - If the statement is an if-else construct, and one of either blocks
# contain more than 1 statement, both blocks use braces.
# - If the statement consists of several nested blocks of the same kind, and
# any of the statement bodies cannot be expressed as a braceless block, all
# nested blocks use braces.
# Warn: Cannot be tested.
# Note: Going by the statements above, one-liners will be avoided.
AllowShortIfStatementsOnASingleLine: Never
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlignAfterOpenBracket: AlwaysBreak

# 11. Variable names in declarations are not aligned, unless it improves
# readability.
# Warn: A general rule must be set. Going for not aligned.

# 12. Structure member names are not aligned, unless it improves readability.
# Warn: A general rule must be set. Going for not aligned.

# 13. Pointer declarations leave a space between the type and the stars, and no
# space between the stars and the identifier, or between the stars themselves.
DerivePointerAlignment: false
PointerAlignment: Right

# 14. In C code, we favor lower snake case for variables, types and function
# names.
# Warn: Cannot be checked. User responsibility.

# 15. In C/C++ code, we favor upper snake case for #defines and enumerated constants.
# Warn: Cannot be checked. User responsibility.

# 16. Ident preprocessor directives after the hash
IndentPPDirectives: AfterHash
78 changes: 70 additions & 8 deletions .github/workflows/cmake.yml
Expand Up @@ -2,23 +2,40 @@ name: CI

on:
push:
branches: [ develop ]
branches: [ master ]
pull_request:
branches: [ develop ]
branches: [ master ]
workflow_dispatch:

inputs:
debug_enabled:
description: 'Build and run interactive shell'
required: false
default: false

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build-all:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# Installation of dependencies is too OS-dependent now, we don't
# miss that much by particularizing this in a per-OS basis.

runs-on: ${{ matrix.os }}
build-linux:
runs-on: ubuntu-latest
steps:
- name: Setup interactive shell session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}

- name: Install sndfile
run: sudo apt-get install libsndfile1-dev

- name: Install Volk
run: sudo apt-get install libvolk2-dev

- name: Install FFTW3
run: sudo apt-get install libfftw3-dev

- name: Checkout
uses: actions/checkout@v2

Expand All @@ -27,4 +44,49 @@ jobs:

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}


build-macos:
runs-on: macos-latest
steps:
- name: Setup interactive shell session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}

- name: Install sndfile
run: brew install libsndfile

- name: Install Volk
run: brew install volk

- name: Install FFTW3
run: brew install fftw

- name: Checkout
uses: actions/checkout@v2

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-libsndfile mingw-w64-x86_64-fftw mingw-w64-x86_64-volk

- name: Configure CMake
run: /mingw64/bin/cmake -B '${{github.workspace}}/build' -G"MinGW Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/mingw64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: /mingw64/bin/cmake --build '${{github.workspace}}/build' --config ${{env.BUILD_TYPE}}


1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
build/
4 changes: 3 additions & 1 deletion AUTHORS
Expand Up @@ -3,4 +3,6 @@

- Mehdi Asgari <https://github.com/mehdideveloper>
Complex float API support in C++


- Ángel Ruiz Fernández <https://github.com/arf20>
Windows support

0 comments on commit 1d7559d

Please sign in to comment.