Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[open62541] added multithreading feature #43327

Merged
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
5 changes: 5 additions & 0 deletions ports/open62541/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ elseif("mbedtls" IN_LIST FEATURES)
set(OPEN62541_ENCRYPTION_OPTIONS -DUA_ENABLE_ENCRYPTION=MBEDTLS)
endif()

if("multithreading" IN_LIST FEATURES)
set(OPEN62541_MULTITHREADING_OPTIONS -DUA_MULTITHREADING=100)
endif()

Comment on lines +44 to +47
Copy link
Member

Choose a reason for hiding this comment

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

@reinder, Thanks for your PR, I think it is unreasonable to set -DUA_MULTITHREADING=100 as the value for whether to turn on the option OPEN62541_MULTITHREADING_OPTIONS. If the user sets the multithreading value to a value other than 100, multithreading still cannot be turned on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JonLiu1993 thanks the review.

The current version of the open62541 library only uses UA_MULTITHREADING >= 100, until that changes it will work. (There is one test that contains a UA_MULTITHREADING >= 200 somehow, but vcpkg skips the test anyway.)
open62541 also generates a config.h header in the include folder that #define's UA_MULTITHREADING, so there is no need for the user to set that define.

If I did understand you feedback incorrectly, please let me know. If there is a better vcpkg solution to implement this kind of feature please let me know too.

vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")
Expand All @@ -50,6 +54,7 @@ vcpkg_cmake_configure(
OPTIONS
${FEATURE_OPTIONS}
${OPEN62541_ENCRYPTION_OPTIONS}
${OPEN62541_MULTITHREADING_OPTIONS}
"-DOPEN62541_VERSION=v${VERSION}"
-DUA_ENABLE_DEBUG_SANITIZER=OFF
-DUA_MSVC_FORCE_STATIC_CRT=OFF
Expand Down
4 changes: 4 additions & 0 deletions ports/open62541/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "open62541",
"version": "1.3.15",
"port-version": 1,
"description": "open62541 is an open source C (C99) implementation of OPC UA licensed under the Mozilla Public License v2.0.",
"homepage": "https://open62541.org",
"license": "MPL-2.0",
Expand Down Expand Up @@ -42,6 +43,9 @@
"methodcalls": {
"description": "Enable the Method service set"
},
"multithreading": {
"description": "Enable multi threading support"
},
"openssl": {
"description": "Enable encryption support (uses OpenSSL)",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6626,7 +6626,7 @@
},
"open62541": {
"baseline": "1.3.15",
"port-version": 0
"port-version": 1
},
"open62541pp": {
"baseline": "0.16.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/open62541.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "069f0994eea700649515980c5d35eb9157bbe990",
"version": "1.3.15",
"port-version": 1
},
{
"git-tree": "96ef706dfc63eac612ac3a62f5884f88aaba030c",
"version": "1.3.15",
Expand Down