Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,26 @@ Checks: >
readability-duplicate-include,
readability-misleading-indentation,
readability-redundant-control-flow,
readability-redundant-smartptr-get
readability-redundant-smartptr-get,
modernize-*,
-modernize-use-trailing-return-type,
cppcoreguidelines-*,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-owning-memory,
-modernize-avoid-variadic-functions,
-cppcoreguidelines-avoid-c-arrays,
-modernize-avoid-c-arrays,
-clang-analyzer-unix.StdCLibraryFunctions

WarningsAsErrors: '*'

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand All @@ -26,7 +30,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update
apt-get install -y cmake ninja-build clang lld llvm cppcheck clang-tidy \
apt-get install -y cmake ninja-build clang lld llvm cppcheck clang-tidy clang-tools \
git curl zip unzip tar pkg-config

- name: Setup vcpkg
Expand Down Expand Up @@ -63,7 +67,7 @@ jobs:

- name: Run clang-tidy
run: |
find src -name '*.cpp' -print0 | xargs -0 -r clang-tidy -p build
run-clang-tidy -p build -j $(nproc)

debug-build-linux:
name: Debug Build Artifacts (Linux)
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- 'v*'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.15)
project(ByeByeVPN LANGUAGES CXX)

include(CTest)
include(ProcessorCount)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -16,6 +17,13 @@ option(BYEBYEVPN_ENABLE_UBSAN "Enable UndefinedBehaviorSanitizer" OFF)
option(BYEBYEVPN_ENABLE_MSAN "Enable MemorySanitizer (Clang/Linux only)" OFF)
option(BYEBYEVPN_ENABLE_TSAN "Enable ThreadSanitizer" OFF)

ProcessorCount(BYEBYEVPN_HOST_PROCESSOR_COUNT)
if(NOT BYEBYEVPN_HOST_PROCESSOR_COUNT GREATER 0)
set(BYEBYEVPN_HOST_PROCESSOR_COUNT 1)
endif()
set(BYEBYEVPN_TEST_SHARDS "${BYEBYEVPN_HOST_PROCESSOR_COUNT}" CACHE STRING
"Number of Catch2 shards to register with CTest")

if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
endif()
Expand Down Expand Up @@ -56,7 +64,7 @@ function(byebyevpn_apply_common_warnings target_name)
endif()
else()
target_compile_options(${target_name} PRIVATE -Wall -Wextra -Wpedantic)
if(WIN32)
if(WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${target_name} PRIVATE -Wno-language-extension-token)
endif()
if(BYEBYEVPN_WARNINGS_AS_ERRORS)
Expand Down
Loading
Loading