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
29 changes: 6 additions & 23 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
- main
workflow_dispatch:

env:
VCPKG_COMMIT_ID: 'ad25766aefb5313b6bc4e2a4b78a2946f84fbf66'

jobs:
build_and_test:
name: ${{ matrix.os }}-${{ github.workflow }}
Expand All @@ -23,12 +20,6 @@ jobs:
include:
- os: windows-latest
cmake_preset: msvc22
# extra_args: -D ZQ_WITH_PROTO=OFF
# there was this odd error that could not be reproduced locally on Windos 10 or 11
# -> Running cpp protocol buffer compiler on D:/a/zq/zq/proto/pingpong.proto
# The system cannot find the batch label specified - VCEnd
# error MSB8066
# need to look into it extra ,but for now, disable proto on Windows
- os: ubuntu-latest
cmake_preset: ninja
- os: macos-latest
Expand All @@ -50,23 +41,15 @@ jobs:

- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.29.0"
cmakeVersion: "~4.0.0"
ninjaVersion: "^1.12.0"

# it's not good to not test proto on Windows, but that accelerates the build for Windows
# - name: Remove protobuf from vcpkg.json on Windows
# run: |
# (Get-Content -path vcpkg.json) | Where-Object { $_ -notmatch '^\s*"protobuf",\s*$' } | Set-Content -Path vcpkg.json
# shell: pwsh
# if: matrix.os == 'windows-latest'

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}'
vcpkgJsonGlob: 'vcpkg.json'
- name: Update vcpkg
shell: bash
run: |
git -C "$VCPKG_INSTALLATION_ROOT" fetch origin master
git -C "$VCPKG_INSTALLATION_ROOT" reset --hard origin/master

- name: Configure CMake
run: |
Expand Down
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ endif()

option(ZQ_WITH_PROTO "Build with protobuf tests" OFF)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)

find_package(astr CONFIG REQUIRED)
find_package(ZeroMQ CONFIG REQUIRED)
find_package(tl-expected CONFIG REQUIRED)

find_package(commonCompilerWarnings CONFIG REQUIRED)

list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

if (${ZQ_TEST_PROJECT})
include(CTest)
include(testing)
include(lib/testing)
add_subdirectory(tests)
endif()

Expand Down Expand Up @@ -65,7 +64,6 @@ endif()
target_link_libraries(zq
INTERFACE
libzmq
tl::expected # until C++23
a4z::astr
)

Expand Down
168 changes: 7 additions & 161 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,163 +1,9 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 27,
"patch": 0
},
"configurePresets": [
{
"name": "base",
"hidden": true,
"binaryDir": "${sourceDir}/build/${presetName}",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"CMAKE_MODULE_PATH": "${sourceDir}/cmake",
"CMAKE_PROJECT_INCLUDE": "cmake-plugins"
}
},
{
"inherits": "base",
"name": "ninja",
"displayName": "Ninja (multi-config)",
"description": "Default Ninja Multi-Config",
"generator": "Ninja Multi-Config"
},
{
"inherits": "base",
"name": "msvc22",
"displayName": "VisualStudio",
"description": "Config for VisualStudio",
"generator": "Visual Studio 17 2022"
},
{
"inherits": "base",
"name": "xcode",
"displayName": "XCode",
"description": "Config for Xcode",
"generator": "Xcode"
},
{
"inherits": "base",
"name": "gcc14",
"displayName": "Gcc-14",
"description": "Gcc-14, Ninja Multi-Config",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "${sourceDir}/cmake/gcc14-toolchain.cmake",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake",
"VCPKG_TARGET_TRIPLET": "gcc14-triplet"
}
}
],
"buildPresets": [
{
"name": "ninja",
"configurePreset": "ninja",
"configuration": "Debug"
},
{
"name": "ninja-release",
"configurePreset": "ninja",
"configuration": "Release"
},
{
"name": "msvc22",
"configurePreset": "msvc22",
"configuration": "Debug"
},
{
"name": "msvc22-release",
"configurePreset": "msvc22",
"configuration": "Release"
},
{
"name": "xcode",
"configurePreset": "xcode",
"configuration": "Debug"
},
{
"name": "xcode-release",
"configurePreset": "xcode",
"configuration": "Release"
},
{
"name": "gcc14",
"configurePreset": "gcc14",
"configuration": "Debug"
},
{
"name": "gcc14-release",
"configurePreset": "gcc14",
"configuration": "Release"
}
],
"testPresets": [
{
"name": "ninja",
"configurePreset": "ninja",
"configuration": "Debug",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "ninja-release",
"inherits": "ninja",
"configuration": "Release"
},
{
"name": "msvc22",
"configurePreset": "msvc22",
"configuration": "Debug"
},
{
"name": "msvc22-release",
"configurePreset": "msvc22",
"configuration": "Release"
},
{
"name": "xcode",
"configurePreset": "xcode",
"configuration": "Debug"
},
{
"name": "xcode-release",
"configurePreset": "xcode",
"configuration": "Release"
},
{
"name": "gcc14",
"configurePreset": "gcc14",
"configuration": "Debug"
},
{
"name": "gcc14-release",
"inherits": "gcc14",
"configuration": "Release"
}
],
"workflowPresets": [
{
"name": "xcode",
"steps": [
{
"type": "configure",
"name": "xcode"
},
{
"type": "build",
"name": "xcode"
},
{
"type": "test",
"name": "xcode"
}
]
}
"version": 10,
"include": [
"cmake/preset/ninja.json",
"cmake/preset/xcode.json",
"cmake/preset/msvc22.json",
"cmake/preset/msvc26.json"
]
}
}
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ After the project has been built, you are ready to run the tests:
ctest --preset=<name>
```



## GitDiagram

Generated via: https://gitdiagram.com/a4z/zq
Generated via: <https://gitdiagram.com/a4z/zq>

```mermaid
graph TB
Expand Down Expand Up @@ -143,4 +141,4 @@ graph TB

```

😊
😊
27 changes: 27 additions & 0 deletions cmake/add-on/coverage-clang.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
include_guard(GLOBAL)

if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
message(STATUS "-- Clang Coverage enabled, CMAKE_CXX_COMPILER:" ${CMAKE_CXX_COMPILER})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-instr-generate")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-instr-generate")
else()
message(FATAL_ERROR "Clang Coverage is only supported with Clang")
endif()

set(COVERAGE_TOOL "llvm-profdata")

add_custom_target(coverage
COMMAND ${CMAKE_COMMAND} -E env "PATH=$ENV{PATH}"
${CMAKE_CURRENT_LIST_DIR}/coverage-report-clang.sh --build-dir ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating coverage report using coverage-report-clang.sh"
)

add_custom_target(clean_coverage
COMMAND find . -name '*.profraw' -delete
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)


46 changes: 46 additions & 0 deletions cmake/add-on/coverage-gcov.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
include_guard(GLOBAL)

# TODO , check that we are on GCC
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(FATAL_ERROR "This coverage implementation requires the GCC compiler")
endif()


message(STATUS "----- GNU Coverage enabled")
# TODO, add -fprofile-abs-path when compiler is gcc
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")



find_program(LCOV lcov)
find_program(GCOV gcov)
if(NOT GCOV)
message(FATAL_ERROR "gcov tool not found for GCC version ${GCC_MAJOR_VERSION}")
endif()

set(COVERAGE_BRANCHES "--rc branch_coverage=1")
# these warnings are ridiculous, they depend on the lcov genhtml version
set(COVERAGE_WARNINGS "--ignore-errors gcov --ignore-errors mismatch --ignore-errors unused")
set(GENHTML_WARNINGS "")

set(COVERAGE_TOOL "lcov")

separate_arguments(COVERAGE_BRANCHES)
separate_arguments(COVERAGE_WARNINGS)
separate_arguments(GENHTML_WARNINGS)
add_custom_target(coverage
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
COMMAND lcov --directory . --capture --output-file ${CMAKE_BINARY_DIR}/coverage/coverage.info ${COVERAGE_WARNINGS} ${COVERAGE_BRANCHES}
COMMAND lcov --remove ${CMAKE_BINARY_DIR}/coverage/coverage.info '/usr/*' '*/tests/*' '*/vcpkg_installed/*' '${CMAKE_BINARY_DIR}/_deps/*' '${CMAKE_SOURCE_DIR}/external/*' --output-file ${CMAKE_BINARY_DIR}/coverage/coverage.info.cleaned ${COVERAGE_WARNINGS} ${COVERAGE_BRANCHES}
COMMAND genhtml --branch-coverage ${CMAKE_BINARY_DIR}/coverage/coverage.info.cleaned --output-directory ${CMAKE_BINARY_DIR}/coverage ${GENHTML_WARNINGS} ${COVERAGE_BRANCHES}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)


add_custom_target(clean_coverage
COMMAND find . -name '*.gcda' -delete
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
Loading