Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kheaactua
Copy link
Contributor

@kheaactua kheaactua commented Jun 28, 2024

Description

General CMakeLists improvements - cmake v2→v3

  • Included a .cmake-format file, and ran applied it to the main CMakeList files in this project.
    • The format file does a poor job on if and foreach blocks, but I believe overall it does a better job that the default settings. The main benefit is a consistent format
  • Use targets instead of lib/include variables in CMake
  • [Conditionally] Linking DLT as a target
  • Write internal.hpp to build directory instead of source to prevent needless rebuilds
    • The include directives for this file are also updated in the code to use include paths rather than relative paths.
  • Remove hard coded CMAKE_VERBOSE_MAKEFILE, this should be injected by the user if so desired
  • "wrap"ing (ld's --wrap option) the "socket" symbol, see wrappers.cpp
  • Added install directive to vsomeip/example/hello_world and vsomeip_ctrl
  • Platform conditional socket lib linkage
  • hello_world code uses ENABLE_SIGNALS, but its setting was missing in CMake
  • Improve setup for boost stacktrace, really only helps on Linux and requires the backtrace.h file
  • Added QNX platform section, though the credential code changes for QNX are not included in this commit.
  • Use a CACHE variable for VSOMEIP_BASE_PATH. Upstream defaults this to /var for QNX which is a very bad choice.

Misc

  • Added more ignore rules to for common IDEs

Comment on lines 112 to 139
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_WERROR "Enable -Werror flag" ON "CMAKE_SYSTEM_NAME MATCHES LINUX" OFF)
if (ENABLE_WERROR)
message(STATUS "Enabling -Werror flag")
add_compile_options(-Werror)
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you separated this flag from the others related to LINUX?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -Werror blocks my linux builds :) Honestly I don't think any component should ever include this. -Werror should be up to the toolchain - as the toolchain usually specifies which compile options to use, which warnings to watch for, and whether warnings should be allowed.

@kheaactua
Copy link
Contributor Author

I am still working on this PR, I'll likely rebase to Fabio's 3.5.x branch. Stuff just takes time. :)

@duartenfonseca
Copy link
Collaborator

I am still working on this PR, I'll likely rebase to Fabio's 3.5.x branch. Stuff just takes time. :)

In that case maybe i will check this PR later! great job anyway, it has interesting improvements

@kheaactua kheaactua force-pushed the modern_cmake branch 6 times, most recently from 46c5cac to da94c06 Compare August 16, 2024 21:29
@duartenfonseca
Copy link
Collaborator

duartenfonseca commented Sep 9, 2024

@kheaactua tried to build this new CMake code and got a failure.
I did :
cmake -B build
cmake --build build

I have ubuntu 22.04, gcc version 11.4

the error i got was the following:
/home/duartef/repos/covesa/vsomeip_duarte/vsomeip/implementation/endpoints/src/../../routing/include/../../endpoints/include/netlink_connector.hpp:197:47: error: ‘VSOMEIP_MAX_NETLINK_RETRIES’ was not declared in this scope
197 | static const std::uint32_t max_retries_ = VSOMEIP_MAX_NETLINK_RETRIES;

@kheaactua
Copy link
Contributor Author

@duartenfonseca I'll take a look! Was this on Fabio's 3.5.x? He did push a change to the network tests a few days back.

I'll also fix that conflict that appeared.

@duartenfonseca
Copy link
Collaborator

@kheaactua i just did a checkout to your branch and tried to build!

@duartenfonseca
Copy link
Collaborator

@kheaactua is the increase of minimum version on cmake is really necessary? from our side, we would like to avoid that

@kheaactua
Copy link
Contributor Author

@kheaactua is the increase of minimum version on cmake is really necessary? from our side, we would like to avoid that

I raised it to 3.15 to accommodate Conan 2.0. From the author:

Conan 2.0 requires at least CMake 3.15.

Though not yet posted, I've been prepping covesa/capi-conan, covesa/capi-docker, and some others that all use Conan to set up CommonAPI environments.

Curious though, what would be desirable about staying at 3.13? With 3.23 vsomeip could use file sets for a cleaner install of the includes

Locally I jack it up to 3.30 :)

@duartenfonseca
Copy link
Collaborator

@kheaactua is the increase of minimum version on cmake is really necessary? from our side, we would like to avoid that

I raised it to 3.15 to accommodate Conan 2.0. From the author:

Conan 2.0 requires at least CMake 3.15.

Though not yet posted, I've been prepping covesa/capi-conan, covesa/capi-docker, and some others that all use Conan to set up CommonAPI environments.

Curious though, what would be desirable about staying at 3.13? With 3.23 vsomeip could use file sets for a cleaner install of the includes

Locally I jack it up to 3.30 :)

I understand your reasons, but if we could find a way to keep the CMake changes without increasing from 3.13 would be best. From our internal process, increasing this there would need to be a strong justification for this change.

@kheaactua
Copy link
Contributor Author

kheaactua commented Oct 16, 2024

@kheaactua is the increase of minimum version on cmake is really necessary? from our side, we would like to avoid that

I raised it to 3.15 to accommodate Conan 2.0. From the author:

Conan 2.0 requires at least CMake 3.15.

Though not yet posted, I've been prepping covesa/capi-conan, covesa/capi-docker, and some others that all use Conan to set up CommonAPI environments.
Curious though, what would be desirable about staying at 3.13? With 3.23 vsomeip could use file sets for a cleaner install of the includes
Locally I jack it up to 3.30 :)

I understand your reasons, but if we could find a way to keep the CMake changes without increasing from 3.13 would be best. From our internal process, increasing this there would need to be a strong justification for this change.

I could make Conan apply a patch, that would solve the issue with Conan. I'll give it a try with 3.13 as soon as I can. I may have to remove some of the generator expressions to support 3.13 as well.

Also, for me the Docker setup for the network tests fails with CMake 3.22 and below.

That said, I would strongly encourage the update.

  • 3.26 supports LTO detection on QNX
  • 3.26 improves the debug on try_compile - really helpful when trying to build on new systems
  • 3.23 brings target_source( FILE_SET ) for better installation
  • 3.18 and 3.30 improve how Boost is found (even as far back as 3.16 find_package(boost) is harder than it should be)
  • 3.15 improves generator expressions
  • 3.14 and 3.27 improve the build debug
  • ~3.30 (I think) improves handling of generated files (helpful for CommonAPI)

Just a tonne of updates that help both with QNX and really just in general.

@kheaactua kheaactua force-pushed the modern_cmake branch 5 times, most recently from e2c4cdc to 9c53ff7 Compare November 26, 2024 13:19
@duartenfonseca duartenfonseca changed the base branch from master to vsomeip_3.5.3 November 26, 2024 17:07
@kheaactua kheaactua force-pushed the modern_cmake branch 2 times, most recently from d56e11e to 38c935a Compare November 26, 2024 17:53
@duartenfonseca duartenfonseca force-pushed the vsomeip_3.5.3 branch 2 times, most recently from 2638cb5 to 74bc25d Compare November 27, 2024 17:11
kheaactua and others added 24 commits July 17, 2025 14:28
Suggested by Duarte, a better fix is likely to be posted upstream.
Restoring install destination for vsomeip_ctrl
Removing leading -D on add_compile_definitions for backwards compatiblity pre CMake 3.26
Removed hardcoded `_QNX_SOURCE` define in build.  This should be
provided by the toolchain via the choice of C++ standard.  Specifically,
extensions should be enabled (e.g. using `-std=gnu++17`)

See https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.utilities/topic/q/qcc.html
…al CMakeLists improvements - cmake v2→v3

Removing RT_INTERFACE and librt
…p! General CMakeLists improvements - cmake v2→v3

Removed the long lines of ####
…up! fixup! General CMakeLists improvements - cmake v2→v3

Reverting to variable variable names
…up! fixup! fixup! General CMakeLists improvements - cmake v2→v3
…up! fixup! fixup! fixup! General CMakeLists improvements - cmake v2→v3
…up! fixup! fixup! fixup! fixup! General CMakeLists improvements - cmake v2→v3

Typo
…gment_length_. changed the variable on hpp to constexpr.
@duartenfonseca duartenfonseca merged commit 39f6770 into COVESA:master Jul 17, 2025
2 checks passed
duartenfonseca pushed a commit that referenced this pull request Aug 18, 2025
Changes:
Add .git-blame-ignore-revs
misc: format codebase
Revert cmake refactor
udp_server_endpoint_impl refactoring
clear multicast only for last subscriber
Ensure that a broken connection is forwarded to the app
Fix connection drop routing to server
fixing changes from cmakelists update
Change order of local endpoint clean-up
Fix increase in exported symbols
Update security offer rule for messages
plugin: remove load_plugins
endpoints: fix use of bound client
Code Quality: Address shadowing (#840)
check routing ready on options_condition predicate
Adapt new netlink test code to current boost.asio API
emi: assign name to multicast worker thread
Adapt new code to current boost.asio API
Updates vsomeip config doc
NetLink changes
fix offer_stop_offer_test
Testing local tcp communication with fault injection
Rename IPV3 to IPV4
rmi: improve logging
Ensure client process only once the registration
Always send initial event on subscription
Modernize CMake code (#734)
rmc: drop use of netlink
set TCP_USER_TIMEOUT on boardnet connections
Use current boost.asio API
vsomeip examples on Windows not running
Fix vsomeip unit-tests failing on Windows
Adding missing flag
lse: fix missing timeout handling
Disconnect on error
Set was_not_connected to true if not connected
Client specific debouncing by name
Add predicate to condition variables
Ensure to unsubscribe non selective events
Handle not_socket error on send_cbk
Remove the exponential timer increase from connection
add logs to register subscription handlers
tse: minor logging improvement
Ensure tracing is done after the actual action
Add stdint import for GCC 15 (#890)
rm: fix client registration thread names
make client id show as hex value
replace with remove_known_client
allow to set any service/instance on supress missing events
rms: fix SIGSEGV on application register
misc: remove ERROR_INFO
Add extra documentation for routing info command
Test for registration process
network test for availability handler
fix test false positives
Valgrind memcheck corrections
Enable valgrinds and helgrind removal
set TCP_USER_TIMEOUT on local connections
Removes access member sec rule from received responses
@duartenfonseca duartenfonseca mentioned this pull request Aug 18, 2025
duartenfonseca pushed a commit that referenced this pull request Aug 18, 2025
Changes:
Add .git-blame-ignore-revs
misc: format codebase
Revert cmake refactor
udp_server_endpoint_impl refactoring
clear multicast only for last subscriber
Ensure that a broken connection is forwarded to the app
Fix connection drop routing to server
fixing changes from cmakelists update
Change order of local endpoint clean-up
Fix increase in exported symbols
Update security offer rule for messages
plugin: remove load_plugins
endpoints: fix use of bound client
Code Quality: Address shadowing (#840)
check routing ready on options_condition predicate
Adapt new netlink test code to current boost.asio API
emi: assign name to multicast worker thread
Adapt new code to current boost.asio API
Updates vsomeip config doc
NetLink changes
fix offer_stop_offer_test
Testing local tcp communication with fault injection
Rename IPV3 to IPV4
rmi: improve logging
Ensure client process only once the registration
Always send initial event on subscription
Modernize CMake code (#734)
rmc: drop use of netlink
set TCP_USER_TIMEOUT on boardnet connections
Use current boost.asio API
vsomeip examples on Windows not running
Fix vsomeip unit-tests failing on Windows
Adding missing flag
lse: fix missing timeout handling
Disconnect on error
Set was_not_connected to true if not connected
Client specific debouncing by name
Add predicate to condition variables
Ensure to unsubscribe non selective events
Handle not_socket error on send_cbk
Remove the exponential timer increase from connection
add logs to register subscription handlers
tse: minor logging improvement
Ensure tracing is done after the actual action
Add stdint import for GCC 15 (#890)
rm: fix client registration thread names
make client id show as hex value
replace with remove_known_client
allow to set any service/instance on supress missing events
rms: fix SIGSEGV on application register
misc: remove ERROR_INFO
Add extra documentation for routing info command
Test for registration process
network test for availability handler
fix test false positives
Valgrind memcheck corrections
Enable valgrinds and helgrind removal
set TCP_USER_TIMEOUT on local connections
Removes access member sec rule from received responses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants