diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 5e06ba8ccf..b016953f12 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -86,6 +86,7 @@ jobs: -DECAL_USE_NPCAP=OFF \ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \ -DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \ + -DECAL_THIRDPARTY_BUILD_ABSL=OFF \ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON \ -DECAL_THIRDPARTY_BUILD_TINYXML2=ON \ -DECAL_THIRDPARTY_BUILD_FINEFTP=ON \ diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index dc47fd5344..b24628437c 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -132,6 +132,7 @@ jobs: -DECAL_INSTALL_SAMPLE_SOURCES=ON \ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \ -DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \ + -DECAL_THIRDPARTY_BUILD_ABSL=OFF \ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON \ -DECAL_THIRDPARTY_BUILD_TINYXML2=ON \ -DECAL_THIRDPARTY_BUILD_FINEFTP=ON \ diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 55b9c42b50..0cbaf19f25 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -104,6 +104,7 @@ jobs: -DECAL_USE_NPCAP=ON ^ -DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON ^ -DECAL_THIRDPARTY_BUILD_PROTOBUF=ON ^ + -DECAL_THIRDPARTY_BUILD_ABSL=ON ^ -DECAL_THIRDPARTY_BUILD_SPDLOG=ON ^ -DECAL_THIRDPARTY_BUILD_TINYXML2=ON ^ -DECAL_THIRDPARTY_BUILD_FINEFTP=OFF ^ @@ -165,6 +166,17 @@ jobs: run: cmake --build . --config Debug working-directory: ${{ runner.workspace }}/_build/sdk + - name: SDK Integration test + run: | + cmake --install "${{ runner.workspace }}/_build/sdk" --prefix "${{ runner.workspace }}/_install/sdk" --config Debug + cmake -G "Visual Studio 16 2019" -A x64 -T v142 ^ + -S serialization/protobuf/samples/pubsub/person_loopback ^ + -B _integration_test_build ^ + -DCMAKE_CONFIGURATION_TYPES="Debug" ^ + -DCMAKE_PREFIX_PATH="${{ runner.workspace }}/_install/sdk" + cmake --build _integration_test_build --config Debug + shell: cmd + - name: Build Release run: cmake --build . --config Release working-directory: ${{ runner.workspace }}/_build/complete diff --git a/.gitmodules b/.gitmodules index 2c401a82e1..43c33a1c63 100644 --- a/.gitmodules +++ b/.gitmodules @@ -55,3 +55,6 @@ [submodule "thirdparty/tsl-robin-map/tsl-robin-map"] path = thirdparty/tsl-robin-map/tsl-robin-map url = https://github.com/Tessil/robin-map.git +[submodule "thirdparty/absl"] + path = thirdparty/absl/absl + url = https://github.com/abseil/abseil-cpp.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 64d3360ed8..987e82000a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,18 +274,47 @@ file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH) message(STATUS "Module Path: ${CMAKE_MODULE_PATH}") message(STATUS "Prefix Path: ${CMAKE_PREFIX_PATH}") -# -------------------------------------------------------- -# detect qt library -# -------------------------------------------------------- -if(MSVC) - if (ECAL_USE_QT) - find_package(QT NAMES Qt6 Qt5 COMPONENTS Core QUIET) - if (NOT "${QT_FOUND}") - include("cmake/qt_msvc_path.cmake") - autodetect_qt_msvc_dir() - endif() +# ------- +# Select C++ standard +# Abseil requires everything to be built with a consistent C++ standard. +# If abseil is built with C++14 but a component building with C++17 tries to use +# abseil (eg: via protobuf) there will be a mismatch and possibly a build failure. +# This is most prevalent with string_view where C++14 will use the abseil type +# but C++17 use std::string_view +# ------- + +# C++14 is the baseline required standard +set(_ECAL_CXX_STD 14) + +# Some dependencies require C++17, which we must detect and push to everything +if(ECAL_USE_QT) + find_package(QT NAMES Qt6 Qt5 COMPONENTS Core QUIET) + if(MSVC AND NOT "${QT_FOUND}") + include("cmake/qt_msvc_path.cmake") + autodetect_qt_msvc_dir() + endif() + if("${QT_VERSION_MAJOR}" VERSION_GREATER 5) + # QT6 has C++17 usage requirements + set(_ECAL_CXX_STD 17) endif() endif() +if(ECAL_USE_FTXUI) + # FTXUI requires C++17 + set(_ECAL_CXX_STD 17) +endif() + +if("${CMAKE_SOURCE_DIR}" STREQUAL "${eCAL_SOURCE_DIR}" AND NOT DEFINED CMAKE_CXX_STANDARD) + # eCAL is being compiled as the root project, and no standard version is set + set(CMAKE_CXX_STANDARD "${_ECAL_CXX_STD}") + message(STATUS "eCAL is using C++ ${_ECAL_CXX_STD}") +else() + # eCAL is part of a larger build or the standard was externally set +endif() + +set(CMAKE_CXX_STANDARD_REQUIRED ON) +if("${CMAKE_CXX_STANDARD}" VERSION_LESS "${_ECAL_CXX_STD}") + message(FATAL_ERROR "eCAL requires CMAKE_CXX_STANDARD to be at least ${_ECAL_CXX_STD} (got: ${CMAKE_CXX_STANDARD})") +endif() find_package(CMakeFunctions REQUIRED) @@ -635,6 +664,7 @@ message(STATUS "ECAL_BUILD_TESTS : ${ECAL_BUI message(STATUS "ECAL_INSTALL_SAMPLE_SOURCES : ${ECAL_INSTALL_SAMPLE_SOURCES}") message(STATUS "ECAL_USE_NPCAP : ${ECAL_USE_NPCAP}") message(STATUS "ECAL_THIRDPARTY_BUILD_ASIO : ${ECAL_THIRDPARTY_BUILD_ASIO}") +message(STATUS "ECAL_THIRDPARTY_BUILD_ABSL : ${ECAL_THIRDPARTY_BUILD_ABSL}") message(STATUS "ECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS : ${ECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS}") message(STATUS "ECAL_THIRDPARTY_BUILD_CURL : ${ECAL_THIRDPARTY_BUILD_CURL}") message(STATUS "ECAL_THIRDPARTY_BUILD_FINEFTP : ${ECAL_THIRDPARTY_BUILD_FINEFTP}") diff --git a/NOTICE.md b/NOTICE.md index 84fbc809a8..b779372f20 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -295,6 +295,15 @@ yaml-cpp - Binary distributions for Windows - Binary distributions for Linux +abseil + - License: Apache 2.0 + - Project: https://github.com/abseil/abseil-cpp + - Copyright: 2017 The Abseil Authors. + - Included in: + - Git submodule `/thirdparty/absl/absl` + - Binary distributions for Windows + - Binary distributions for Linux + ## Cryptography Content may contain encryption software. The country in which you are currently diff --git a/app/mon/mon_cli/CMakeLists.txt b/app/mon/mon_cli/CMakeLists.txt index f4923bdf0e..82bfd21abc 100644 --- a/app/mon/mon_cli/CMakeLists.txt +++ b/app/mon/mon_cli/CMakeLists.txt @@ -46,7 +46,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE eCAL::protobuf_core eCAL::string_core eCAL::core_pb) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_app(${PROJECT_NAME}) diff --git a/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt b/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt index 36614267a3..7026b2a0eb 100644 --- a/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt +++ b/app/mon/mon_plugins/protobuf_reflection/CMakeLists.txt @@ -69,7 +69,7 @@ target_link_libraries (${PROJECT_NAME} PRIVATE MonitorTreeView eCAL::mon_plugin_lib ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) if(MSVC) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4127 /wd4714") diff --git a/app/mon/mon_plugins/signals_plotting/CMakeLists.txt b/app/mon/mon_plugins/signals_plotting/CMakeLists.txt index 6d6f0f0c96..fc574dc212 100644 --- a/app/mon/mon_plugins/signals_plotting/CMakeLists.txt +++ b/app/mon/mon_plugins/signals_plotting/CMakeLists.txt @@ -84,7 +84,7 @@ target_link_libraries (${PROJECT_NAME} PRIVATE CustomQt ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) if(MSVC) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4127 /wd4714" ) diff --git a/app/mon/mon_tui/CMakeLists.txt b/app/mon/mon_tui/CMakeLists.txt index 24208ac2a3..0818de5a2b 100644 --- a/app/mon/mon_tui/CMakeLists.txt +++ b/app/mon/mon_tui/CMakeLists.txt @@ -125,7 +125,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE ftxui::dom ftxui::component) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_app(${PROJECT_NAME}) diff --git a/app/util/config/CMakeLists.txt b/app/util/config/CMakeLists.txt index 175743666e..b6fd16f5c5 100644 --- a/app/util/config/CMakeLists.txt +++ b/app/util/config/CMakeLists.txt @@ -16,7 +16,7 @@ # # ========================= eCAL LICENSE ================================= -project(config) +project(ecal_config) set(ecalconfig_src src/ecal_config.cpp diff --git a/cmake/submodule_dependencies.cmake b/cmake/submodule_dependencies.cmake index c96caa62ab..2cd61e92e7 100644 --- a/cmake/submodule_dependencies.cmake +++ b/cmake/submodule_dependencies.cmake @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.24) set(ecal_submodule_dependency_provider_root_dir ${CMAKE_CURRENT_LIST_DIR}) set(ecal_submodule_dependencies + absl asio CMakeFunctions CURL @@ -72,4 +73,4 @@ endmacro() cmake_language( SET_DEPENDENCY_PROVIDER ecal_dependencies_provider SUPPORTED_METHODS FIND_PACKAGE -) \ No newline at end of file +) diff --git a/cpack/innosetup/ecal_setup.iss.in b/cpack/innosetup/ecal_setup.iss.in index a09074936e..5ac583575b 100644 --- a/cpack/innosetup/ecal_setup.iss.in +++ b/cpack/innosetup/ecal_setup.iss.in @@ -115,7 +115,6 @@ Source: "{#ComponentStagingDir}\libprotobuf-lite\*"; DestDir: "{app}"; Source: "{#ComponentStagingDir}\libprotoc\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf Source: "{#ComponentStagingDir}\protobuf-export\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf Source: "{#ComponentStagingDir}\protobuf-headers\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf -Source: "{#ComponentStagingDir}\protobuf-protos\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf Source: "{#ComponentStagingDir}\protoc\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf Source: "{#DebugSdkStagingDir}\libprotobuf\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf @@ -123,7 +122,6 @@ Source: "{#DebugSdkStagingDir}\libprotobuf-lite\*"; DestDir: "{app}"; Source: "{#DebugSdkStagingDir}\libprotoc\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf Source: "{#DebugSdkStagingDir}\protobuf-export\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf ;Source: "{#DebugSdkStagingDir}\protobuf-headers\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf -;Source: "{#DebugSdkStagingDir}\protobuf-protos\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf ; Source: "{#DebugSdkStagingDir}\protoc\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: sdk\protobuf ; sdk\hdf5 diff --git a/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt b/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt index c5c04de48f..1c2922ac8f 100644 --- a/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt +++ b/ecal/samples/cpp/benchmarks/perftool/CMakeLists.txt @@ -43,7 +43,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE src) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) source_group(TREE "${CMAKE_CURRENT_LIST_DIR}" FILES diff --git a/ecal/samples/cpp/misc/time/CMakeLists.txt b/ecal/samples/cpp/misc/time/CMakeLists.txt index fe9115cf1c..5b663a0cd0 100644 --- a/ecal/samples/cpp/misc/time/CMakeLists.txt +++ b/ecal/samples/cpp/misc/time/CMakeLists.txt @@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 3.15) -project(time) +project(ecal_time) find_package(eCAL REQUIRED) diff --git a/serialization/protobuf/samples/pubsub/person_receive/CMakeLists.txt b/serialization/protobuf/samples/pubsub/person_receive/CMakeLists.txt index 43f5846f26..8379de654e 100644 --- a/serialization/protobuf/samples/pubsub/person_receive/CMakeLists.txt +++ b/serialization/protobuf/samples/pubsub/person_receive/CMakeLists.txt @@ -40,7 +40,7 @@ target_link_libraries(${PROJECT_NAME} eCAL::protobuf_core ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_sample(${PROJECT_NAME}) diff --git a/serialization/protobuf/samples/pubsub/proto_dyn_json_rec/CMakeLists.txt b/serialization/protobuf/samples/pubsub/proto_dyn_json_rec/CMakeLists.txt index e25331ced8..0de12b7f6b 100644 --- a/serialization/protobuf/samples/pubsub/proto_dyn_json_rec/CMakeLists.txt +++ b/serialization/protobuf/samples/pubsub/proto_dyn_json_rec/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries(${PROJECT_NAME} eCAL::protobuf_core ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_sample(${PROJECT_NAME}) diff --git a/serialization/protobuf/samples/pubsub/proto_dyn_rec/CMakeLists.txt b/serialization/protobuf/samples/pubsub/proto_dyn_rec/CMakeLists.txt index ebb3e321d0..bf3b8511a2 100644 --- a/serialization/protobuf/samples/pubsub/proto_dyn_rec/CMakeLists.txt +++ b/serialization/protobuf/samples/pubsub/proto_dyn_rec/CMakeLists.txt @@ -36,7 +36,7 @@ target_link_libraries(${PROJECT_NAME} eCAL::protobuf_core ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_sample(${PROJECT_NAME}) diff --git a/serialization/protobuf/tests/pubsub_proto_test/CMakeLists.txt b/serialization/protobuf/tests/pubsub_proto_test/CMakeLists.txt index fbc3f81aae..266839f112 100644 --- a/serialization/protobuf/tests/pubsub_proto_test/CMakeLists.txt +++ b/serialization/protobuf/tests/pubsub_proto_test/CMakeLists.txt @@ -47,7 +47,7 @@ target_link_libraries(${PROJECT_NAME} ) -target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14) ecal_install_gtest(${PROJECT_NAME}) diff --git a/thirdparty/absl/absl b/thirdparty/absl/absl new file mode 160000 index 0000000000..d9e4955c65 --- /dev/null +++ b/thirdparty/absl/absl @@ -0,0 +1 @@ +Subproject commit d9e4955c65cd4367dd6bf46f4ccb8cd3d100540b diff --git a/thirdparty/absl/build-absl.cmake b/thirdparty/absl/build-absl.cmake new file mode 100644 index 0000000000..a24161c58c --- /dev/null +++ b/thirdparty/absl/build-absl.cmake @@ -0,0 +1,9 @@ +include_guard(GLOBAL) + +# Copied out of protobuf/cmake/abseil-cpp.cmake +if(protobuf_INSTALL) + # When protobuf_INSTALL is enabled and Abseil will be built as a module, + # Abseil will be installed along with protobuf for convenience. + set(ABSL_ENABLE_INSTALL ON) +endif() +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/absl" "${eCAL_BINARY_DIR}thirdparty/absl" SYSTEM) diff --git a/thirdparty/protobuf/build-protobuf.cmake b/thirdparty/protobuf/build-protobuf.cmake index 051470d838..eaa420f9d2 100644 --- a/thirdparty/protobuf/build-protobuf.cmake +++ b/thirdparty/protobuf/build-protobuf.cmake @@ -1,8 +1,11 @@ +# Protobuf 4(.25.X) is skipped because of a regression with msvc that never +# had its fix backported. +# https://github.com/protocolbuffers/protobuf/issues/14602 set(Protobuf_PROTOC_EXECUTABLE protoc) -set(Protobuf_VERSION 3.11.4) -set(Protobuf_VERSION_MAJOR 3) -set(Protobuf_VERSION_MINOR 11) -set(Protobuf_VERSION_PATCH 4) +set(Protobuf_VERSION 5.29.5) +set(Protobuf_VERSION_MAJOR 5) +set(Protobuf_VERSION_MINOR 29) +set(Protobuf_VERSION_PATCH 5) include_guard(GLOBAL) @@ -12,6 +15,10 @@ if(UNIX) set(protobuf_BUILD_SHARED_LIBS ON CACHE BOOL "My option" FORCE) endif() +set(protobuf_BUILD_LIBUPB OFF CACHE BOOL "libupb is disabled" FORCE) +set(protobuf_USE_EXTERNAL_GTEST ON CACHE BOOL "Do not use protobuf vendored gtest" FORCE) +set(protobuf_ABSL_PROVIDER "package") + if(MSVC) message(STATUS "supress thirdparty warnings for windows platform ..") set(CMAKE_CXX_FLAGS_OLD "${CMAKE_CXX_FLAGS}") @@ -23,10 +30,7 @@ if(MSVC) endif() ecal_disable_all_warnings() -ecal_variable_push(CMAKE_POLICY_VERSION_MINIMUM) -set(CMAKE_POLICY_VERSION_MINIMUM 3.5) -add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/protobuf/cmake" "${eCAL_BINARY_DIR}/thirdparty/protobuf" SYSTEM) -ecal_variable_pop(CMAKE_POLICY_VERSION_MINIMUM) +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/protobuf" "${eCAL_BINARY_DIR}/thirdparty/protobuf" SYSTEM) ecal_restore_warning_level() if (NOT TARGET protobuf::libprotobuf) diff --git a/thirdparty/protobuf/protobuf b/thirdparty/protobuf/protobuf index d0bfd52211..f5de0a0495 160000 --- a/thirdparty/protobuf/protobuf +++ b/thirdparty/protobuf/protobuf @@ -1 +1 @@ -Subproject commit d0bfd5221182da1a7cc280f3337b5e41a89539cf +Subproject commit f5de0a0495faa63b4186fc767324f8b9a7bf4fc4