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
62 changes: 62 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
BasedOnStyle: Chromium
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
#AllowAllArgumentsOnNextLine: 'false'
#AlignConsecutiveAssignments: None
#AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: true
AllowAllParametersOfDeclarationOnNextLine: true
#AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
#AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 140
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBlockIndentWidth: 4
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
#SortIncludes: Never
SpaceAfterCStyleCast: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: 2
Standard: Auto
TabWidth: 4
UseTab: Never
#NamespaceMacros:
# - DECLARE_TEMPLATED_OPENDAQ_INTERFACE_T
# - DECLARE_TEMPLATED_OPENDAQ_INTERFACE_T_U
# - DECLARE_OPENDAQ_INTERFACE_EX
# - DECLARE_OPENDAQ_INTERFACE
FixNamespaceComments: false
#MacroBlockBegin: "^BEGIN_NAMESPACE_OPENDAQ$"
#MacroBlockEnd: "^END_NAMESPACE_OPENDAQ"
#IndentPPDirectives: BeforeHash
#SeparateDefinitionBlocks: Always
...
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[{*.{cpp,h},CMakeLists.txt,*.rtclass,*.cmake,*.json}]
indent_style = space
indent_size = 4
tab_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml]
ident_style = space
ident_size = 2
tab_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto
*.[tT][xX][tT] text
*.[sS][hH] text eol=lf
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build and Test

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
generator: Ninja
- os: windows-latest
generator: "Visual Studio 17 2022"

runs-on: ${{ matrix.os }}

steps:
- name: Install additional dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil

- name: Checkout project repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}

- name: Configure project with CMake
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_LT_STREAMING_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release

- name: Build project with CMake
run: cmake --build build/output --config Release

- name: Run project tests with CMake
run: ctest --test-dir build/output --output-on-failure -C Release

install-build-and-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
generator: Ninja
- os: windows-latest
generator: "Visual Studio 17 2022"

runs-on: ${{ matrix.os }}
env:
INSTALL_PREFIX: ${{ github.workspace }}/opendaq_install

steps:
- name: Install additional dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil

- name: Checkout module
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
path: module

- name: Read openDAQ version
shell: bash
working-directory: module
run: |
opendaq_ref=$(cat opendaq_ref)
echo "OPENDAQ_REF=$opendaq_ref" >> $GITHUB_ENV

- name: Checkout openDAQ
uses: actions/checkout@v4
with:
repository: openDAQ/openDAQ
ref: ${{ env.OPENDAQ_REF }}
path: opendaq

- name: Configure, build and install openDAQ
working-directory: opendaq
run: |
cmake -B build/output -S . -G "${{ matrix.generator }}" -DOPENDAQ_ENABLE_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}"
cmake --build build/output --config Debug
cmake --install build/output --config Debug

- name: Add DLL path (Windows only)
if: matrix.os == 'windows-latest'
run: echo "${{ env.INSTALL_PREFIX }}/lib" >> $env:GITHUB_PATH

- name: Configure project with CMake
working-directory: module
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DDAQMODULES_LT_STREAMING_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DopenDAQ_DIR="${{ env.INSTALL_PREFIX }}/lib/cmake/opendaq/"

- name: Build project with CMake
working-directory: module
run: cmake --build build/output --config Debug

- name: Run project tests with CMake
working-directory: module
run: ctest --test-dir build/output --output-on-failure -C Debug
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# file types
*.bin
*.bak
*.cache
*.check_cache
*.db
*.dcu
*.depend
*.exp
*.filters
*.idb
*.ilk
*.list
*.log
*.obj
*.orig
*.pdb
*.pyc
*.rule
*.rsm
*.stamp
*.stat
*.suo
*.tlog
*.user

# IDE files
.idea/
.idea_/
.vs/
.vscode/
__history/
__recovery/
__pycache__/

# build and backup folders
/_build*
/build*
/build_win
/cmake-build*
/out*
bckp

# cmake
CMakeUserPresets.json
CMakeSettings.json
75 changes: 75 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
cmake_minimum_required(VERSION 3.25)

set(REPO_NAME LtStreamingModulesModern)
set(REPO_OPTION_PREFIX DAQMODULES_LT_STREAMING)

list(APPEND CMAKE_MESSAGE_CONTEXT ${REPO_NAME})
add_subdirectory(cmake)

opendaq_read_file_contents("${CMAKE_CURRENT_LIST_DIR}/module_version" module_version)
opendaq_get_version_major_minor_patch("${module_version}" ${REPO_OPTION_PREFIX}_VERSION)

# 32-bit Linux cross-compilation setup (must be before any project())
if (NOT DEFINED PROJECT_SOURCE_DIR AND OPENDAQ_FORCE_COMPILE_32BIT AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
opendaq_32bit_build_linux_early_setup()
endif()

project(${REPO_NAME} VERSION ${${REPO_OPTION_PREFIX}_VERSION} LANGUAGES CXX)

opendaq_common_early_setup()

if (PROJECT_IS_TOP_LEVEL)
message(STATUS "Building ${REPO_NAME} version ${${REPO_OPTION_PREFIX}_VERSION} standalone")
else()
message(STATUS "Building ${REPO_NAME} version ${${REPO_OPTION_PREFIX}_VERSION} as submodule")
endif()

# options
opendaq_setup_common_build_options()
opendaq_setup_project_specific_build_options(${REPO_OPTION_PREFIX})
option(${REPO_OPTION_PREFIX}_ENABLE_EXAMPLE_APP "Enable ${REPO_NAME} example applications" ${PROJECT_IS_TOP_LEVEL})
option(${REPO_OPTION_PREFIX}_ENABLE_TESTS "Enable ${REPO_NAME} testing" ${PROJECT_IS_TOP_LEVEL})
option(${REPO_OPTION_PREFIX}_ENABLE_CLIENT "Enable ${REPO_NAME} client module" ${PROJECT_IS_TOP_LEVEL})
option(${REPO_OPTION_PREFIX}_ENABLE_SERVER "Enable ${REPO_NAME} server module" ${PROJECT_IS_TOP_LEVEL})

opendaq_common_compile_targets_settings()
opendaq_setup_compiler_flags(${REPO_OPTION_PREFIX})

if (${REPO_OPTION_PREFIX}_ENABLE_TESTS)
message(STATUS "Unit tests in ${REPO_NAME} are ENABLED")
enable_testing()
else()
message(STATUS "Unit tests in ${REPO_NAME} are DISABLED")
endif()

include("${PROJECT_SOURCE_DIR}/external/boost/Boost.cmake")
if (NOT TARGET "${OPENDAQ_SDK_TARGET_NAMESPACE}::${OPENDAQ_SDK_TARGET_NAME}")
if (PROJECT_IS_TOP_LEVEL)
find_package(${OPENDAQ_SDK_NAME} GLOBAL)
endif()
if (NOT ${OPENDAQ_SDK_NAME}_FOUND)
include(FetchContent)
set(OPENDAQ_ENABLE_TESTS OFF CACHE BOOL "")

opendaq_read_file_contents("${CMAKE_CURRENT_LIST_DIR}/opendaq_ref" OPENDAQ_REF)
opendaq_get_custom_fetch_content_params(${OPENDAQ_SDK_NAME} FC_PARAMS)

FetchContent_Declare(
${OPENDAQ_SDK_NAME}
GIT_REPOSITORY https://github.com/openDAQ/openDAQ.git
GIT_TAG ${OPENDAQ_REF}
GIT_PROGRESS ON
${FC_PARAMS}
)
FetchContent_MakeAvailable(${OPENDAQ_SDK_NAME})
else()
message(STATUS "Found installed ${OPENDAQ_SDK_NAME} version: ${${OPENDAQ_SDK_NAME}_VERSION}")
endif()
endif()
add_subdirectory(external/boost)

add_subdirectory(external)
add_subdirectory(shared)
add_subdirectory(modules)

Loading
Loading