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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ on:

jobs:
build_windows:
runs-on: windows-2022
name: "Windows 2022 Arch: ${{ matrix.arch }}, Shared: ${{ matrix.shared }}"
runs-on: windows-latest
name: "Windows latest Arch: ${{ matrix.arch }}, Shared: ${{ matrix.shared }}"
strategy:
matrix:
arch: ["x86", "amd64"]
Expand Down
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(AGENT_VERSION_MAJOR 2)
set(AGENT_VERSION_MINOR 6)
set(AGENT_VERSION_PATCH 0)
set(AGENT_VERSION_BUILD 2)
set(AGENT_VERSION_BUILD 3)
set(AGENT_VERSION_RC "")

# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent
Expand All @@ -22,13 +22,14 @@ set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/mtconnect")

message(INFO " Shared build: ${SHARED_AGENT_LIB}")

project(cppagent LANGUAGES C CXX)

# We will define these properties by default for each CMake target to be created.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CXX_COMPILE_FEATURES cxx_std_17)
set(CXX_COMPILE_FEATURES cxx_std_20)
set(CMAKE_OSX_DEPLOYMENT_TARGET 13.3)

project(cppagent LANGUAGES C CXX)

set(WITH_RUBY ON CACHE STRING "With Ruby Support")

Expand Down
2 changes: 1 addition & 1 deletion agent/cppagent.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 2 additions & 2 deletions conan/mqtt_cpp/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

class MqttcppConan(ConanFile):
name = "mqtt_cpp"
version = "13.2.1"
version = "13.2.2"
license = "Boost Software License, Version 1.0"
author = "Takatoshi Kondo [email protected]"
url = "https://github.com/redboltz/mqtt_cpp"
description = "MQTT client/server for C++14 based on Boost.Asio"
topics = ("mqtt")
requires = ["boost/1.85.0"]
requires = ["boost/1.88.0"]
no_copy_source = True
exports_sources = "include/*"

Expand Down
2 changes: 1 addition & 1 deletion conan/mruby/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def search_header_path(name)
if is_msvc(self):
if self.settings.build_type == 'Debug':
f.write(" conf.compilers.each { |c| c.flags << '/Od' }\n")
f.write(" conf.compilers.each { |c| c.flags << '/std:c++17' }\n")
f.write(" conf.compilers.each { |c| c.flags << '/std:c++20' }\n")
f.write(" conf.compilers.each { |c| c.flags << '/%s' }\n" % msvc_runtime_flag(self))
else:
if self.settings.build_type == 'Debug':
Expand Down
1 change: 1 addition & 0 deletions conan/profiles/clang
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include(default)

[settings]
compiler.libcxx=libstdc++11
compiler.cppstd=20

[env]
CC=/usr/bin/clang
Expand Down
1 change: 1 addition & 0 deletions conan/profiles/docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include(default)

[settings]
compiler.libcxx=libstdc++11
compiler.cppstd=20

[options]
without_ipv6=True
Expand Down
1 change: 1 addition & 0 deletions conan/profiles/gcc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include(default)

[settings]
compiler.libcxx=libstdc++11
compiler.cppstd=20

[system_tools]
cmake/>3.23.0
2 changes: 1 addition & 1 deletion conan/profiles/macos
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include(default)

[settings]
compiler=apple-clang
compiler.cppstd=gnu17
compiler.cppstd=20

[system_tools]
cmake/>3.26.0
Expand Down
4 changes: 1 addition & 3 deletions conan/profiles/vs32
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ include(default)

[settings]
compiler=msvc
compiler.cppstd=17
compiler.cppstd=20
arch=x86
compiler.runtime=static
compiler.runtime_type=Release
build_type=Release

[options]
winver=0x0600
5 changes: 1 addition & 4 deletions conan/profiles/vs32debug
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ include(default)

[settings]
compiler=msvc
compiler.cppstd=17
compiler.cppstd=20
arch=x86
compiler.runtime=static
compiler.runtime_type=Debug
build_type=Debug

[options]
winver=0x0600
6 changes: 1 addition & 5 deletions conan/profiles/vs32shared
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ include(default)

[settings]
compiler=msvc
compiler.cppstd=17
compiler.cppstd=20
arch=x86
compiler.runtime=dynamic
compiler.runtime_type=Release
build_type=Release


[options]
shared=True
winver=0x0600
2 changes: 1 addition & 1 deletion conan/profiles/vs64
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include(default)

[settings]
compiler=msvc
compiler.cppstd=17
compiler.cppstd=20
arch=x86_64
compiler.runtime=static
compiler.runtime_type=Release
Expand Down
2 changes: 1 addition & 1 deletion conan/profiles/vs64debug
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include(default)

[settings]
compiler=msvc
compiler.cppstd=17
compiler.cppstd=20
arch=x86_64
compiler.runtime=static
compiler.runtime_type=Debug
Expand Down
2 changes: 1 addition & 1 deletion conan/profiles/vs64shared
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include(default)

[settings]
compiler=msvc
compiler.cppstd=17
compiler.cppstd=20
arch=x86_64
compiler.runtime=dynamic
compiler.runtime_type=Release
Expand Down
15 changes: 0 additions & 15 deletions conan/profiles/vsxp

This file was deleted.

2 changes: 1 addition & 1 deletion conan/profiles/xcode
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(default)

[settings]
compiler.cppstd=17
compiler.cppstd=20

[platform_tool_requires]
cmake/3.26.4
Expand Down
24 changes: 9 additions & 15 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MTConnectAgentConan(ConanFile):
"with_ruby": True,
"development": False,
"shared": False,
"winver": "0x0602",
"winver": "0x0A00",
"with_docs": False,
"cpack": False,
"agent_prefix": None,
Expand Down Expand Up @@ -84,10 +84,6 @@ def layout(self):
self.folders.build_folder_vars = ["options.shared", "settings.arch"]
cmake_layout(self)

def layout(self):
self.folders.build_folder_vars = ["options.shared", "settings.arch"]
cmake_layout(self)

def config_options(self):
if is_msvc(self):
self.options.rm_safe("fPIC")
Expand All @@ -105,6 +101,7 @@ def tool_requires_version(self, package, version):
self.output.info(f"Version of {package} is {ver}")
else:
self.output.info(f"Command: '{command}' returned {res}")

if ver < version:
ver_text = '.'.join([str(x) for x in version])
self.output.info(f"Old version of {package}, requesting tool {package}/{ver_text}")
Expand All @@ -118,19 +115,19 @@ def build_requirements(self):
self.tool_requires_version("doxygen", [1, 14, 0])

def requirements(self):
self.requires("boost/1.85.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("libxml2/2.10.3", headers=True, libs=True, visible=True, transitive_headers=True, transitive_libs=True)
self.requires("boost/1.88.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("libxml2/2.14.5", headers=True, libs=True, visible=True, transitive_headers=True, transitive_libs=True)
self.requires("date/3.0.4", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("nlohmann_json/3.9.1", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
self.requires("openssl/3.0.8", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("rapidjson/cci.20220822", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
self.requires("mqtt_cpp/13.2.1", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
self.requires("nlohmann_json/3.12.0", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
self.requires("openssl/3.5.4", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("rapidjson/cci.20230929", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
self.requires("mqtt_cpp/13.2.2", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
self.requires("bzip2/1.0.8", headers=True, libs=True, transitive_headers=True, transitive_libs=True)

if self.options.with_ruby:
self.requires("mruby/3.2.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True)

self.requires("gtest/1.10.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True, test=True)
self.requires("gtest/1.17.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True, test=True)

def configure(self):
if self.options.shared:
Expand All @@ -143,9 +140,6 @@ def configure(self):
if is_msvc(self):
self.options["boost/*"].extra_b2_flags = ("define=BOOST_USE_WINAPI_VERSION=" + str(self.options.winver))

if is_msvc(self):
self.options["boost/*"].extra_b2_flags = ("define=BOOST_USE_WINAPI_VERSION=" + str(self.options.winver))

# Make sure shared builds use shared boost
if is_msvc(self) and self.options.shared:
print("**** Making boost, libxml2, gtest, and openssl shared")
Expand Down
4 changes: 2 additions & 2 deletions docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ WORKDIR /root/agent
COPY . cppagent

ARG WITH_TESTS=false
ARG WITH_TESTS_ARG=argument
ARG WITH_TESTS_ARG=

# Build and optionally test. Unpack the dist to reduce overhead in the following release step.
RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \
Expand All @@ -94,7 +94,7 @@ RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \
-o cpack_name=dist \
-o cpack_generator=TGZ \
-pr "$CONAN_PROFILE" \
"${WITH_TESTS_ARG}" \
${WITH_TESTS_ARG} \
&& tar xf dist.tar.gz \
&& rm dist.tar.gz

Expand Down
9 changes: 4 additions & 5 deletions docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@ ARG CONAN_CPU_COUNT=2
ARG WITH_RUBY='True'

# set some variables
ENV PATH="$HOME/venv3.9/bin:$PATH"
ENV CONAN_PROFILE='/root/agent/cppagent/conan/profiles/docker'

# update os and add dependencies
# note: Dockerfiles run as root by default, so don't need sudo
RUN apt-get update \
&& apt-get install -y \
RUN apt clean && apt update \
&& apt install -y \
autoconf \
automake \
build-essential \
Expand All @@ -72,7 +71,7 @@ WORKDIR /root/agent
COPY . cppagent

ARG WITH_TESTS=false
ARG WITH_TESTS_ARG=argument
ARG WITH_TESTS_ARG=

# Build and optionally test
RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \
Expand All @@ -91,7 +90,7 @@ RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \
-o cpack_name=dist \
-o cpack_generator=TGZ \
-pr "$CONAN_PROFILE" \
"${WITH_TESTS_ARG}" \
${WITH_TESTS_ARG} \
&& tar xf dist.tar.gz \
&& rm dist.tar.gz

Expand Down
6 changes: 3 additions & 3 deletions src/mtconnect/agent.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -477,7 +477,7 @@ namespace mtconnect {
return;
}

auto callback = [=](config::AsyncContext &context) {
auto callback = [=, this](config::AsyncContext &context) {
try
{
bool changed = false;
Expand Down Expand Up @@ -604,7 +604,7 @@ namespace mtconnect {
createUniqueIds(device);

LOG(info) << "Checking if device " << *uuid << " has changed";
if (*device != *oldDev)
if (device->different(*oldDev))
{
LOG(info) << "Device " << *uuid << " changed, updating model";

Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/agent.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/asset/asset.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/asset/asset.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/asset/asset_buffer.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/asset/asset_storage.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/asset/component_configuration_parameters.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/asset/component_configuration_parameters.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/mtconnect/asset/cutting_tool.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”)
// Copyright Copyright 2009-2025, AMT – The Association For Manufacturing Technology (“AMT”)
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading