This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 549808718b52f4951863d306c810b52a8b10b9aa
Author: Andrew Stitcher <[email protected]>
AuthorDate: Fri May 10 10:21:27 2024 -0400

    PROTON-2810: Change C++ language version to C++17
    
    Change documented requirements; Stop linking C++ code with threads
    library as this is now in C++ 17 standard library (everywhere except
    FrewBSD with clang)
---
 CMakeLists.txt                |  2 +-
 INSTALL.md                    | 17 +++++++----------
 cpp/CMakeLists.txt            | 11 +++++++----
 cpp/benchmarks/CMakeLists.txt |  2 +-
 cpp/examples/CMakeLists.txt   | 16 ++++------------
 5 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92c6def69..2e928efeb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,7 +85,7 @@ if (CMAKE_CXX_COMPILER)
 
   enable_language(CXX)
 
-  set(CMAKE_CXX_STANDARD 11)
+  set(CMAKE_CXX_STANDARD 17)
   set(CMAKE_CXX_EXTENSIONS OFF)
 endif()
 
diff --git a/INSTALL.md b/INSTALL.md
index e7152eb68..fa9975143 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -10,22 +10,22 @@ Dependencies
 Cross-platform dependencies
 
   - CMake 3.16+
-  - Python 3.8+ (required to build core C library)
-  - Swig 1.3+ (for the bindings)
+  - Python 3.9+ (required to build core C library)
+  - Swig 1.3+ (for the Ruby binding)
   - Ruby 1.9+ (for the Ruby binding)
   - Go 1.11+ (for the Go binding)
 
 Linux dependencies
 
   - GNU Make 3.81+
-  - GCC 4.8.4+
+  - GCC 9+
   - Cyrus SASL 2.1+ (for SASL support)
   - OpenSSL 1.0+ (for SSL support)
   - JsonCpp 1.8+ for C++ connection configuration file support
 
 Windows dependencies
 
-  - Visual Studio 2015 or newer (regular or C++ Express)
+  - Visual Studio 2019 or newer (Community or Enterprise Editions)
 
 CMake (Linux)
 -------------
@@ -60,7 +60,7 @@ The following prerequisites are required to do a full build on
 Debian-based systems (Ubuntu).  If you do not wish to build a given
 language binding you can omit the dev package for that language.
 
-    # Required dependencies 
+    # Required dependencies
     $ apt-get install gcc g++ cmake cmake-curses-gui uuid-dev
 
     # Dependencies needed for SSL support
@@ -107,8 +107,8 @@ Studio and used to build the Proton library.
 
 The following packages must be installed:
 
-  - Visual Studio 2017 or newer (Community or Enterprise Editions)
-  - Python (www.python.org)
+  - Visual Studio 2019 or newer (Community or Enterprise Editions)
+  - Python 3.9 or newer (www.python.org)
   - CMake (www.cmake.org)
 
 Additional packages are required for language bindings:
@@ -131,9 +131,6 @@ this `INSTALL.md` file:
 
 If CMake doesn't guess things correctly, useful additional arguments are:
 
-    -G "Visual Studio 15 2017"
-or
-
     -G "Visual Studio 16 2019"
 or
 
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 712e26468..106415bca 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -25,8 +25,13 @@ endif()
 include(CMakeDependentOption)
 enable_language(CXX)
 
-set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
-find_package(Threads)
+# This is only needed for FreeBSD with clang (its system compiler)
+# Everything else will get threads support by default with C++ libs
+if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_SYSTEM_NAME STREQUAL 
"FreeBSD")
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+  find_package(Threads)
+  link_libraries(Threads::Threads)
+endif()
 
 include(versions.cmake)
 
@@ -54,8 +59,6 @@ else()
   set(TRACING_SRC src/tracing_stub.cpp src/init_tracer_stub.cpp)
 endif()
 
-list(APPEND PLATFORM_LIBS Threads::Threads)
-
 set(CXX_EXAMPLE_FLAGS "${CXX_WARNING_FLAGS} ${CXX_STANDARD}")
 set(CXX_EXAMPLE_LINK_FLAGS "${SANITIZE_FLAGS}")
 
diff --git a/cpp/benchmarks/CMakeLists.txt b/cpp/benchmarks/CMakeLists.txt
index 63a5bd7e0..57ebea5f7 100644
--- a/cpp/benchmarks/CMakeLists.txt
+++ b/cpp/benchmarks/CMakeLists.txt
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 
diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt
index 0fe54f21d..cbaefbe3c 100644
--- a/cpp/examples/CMakeLists.txt
+++ b/cpp/examples/CMakeLists.txt
@@ -21,10 +21,8 @@ cmake_minimum_required (VERSION 3.16)
 project(ProtonCppExamples C CXX)
 
 find_package(ProtonCpp REQUIRED)
-set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
-find_package(Threads REQUIRED)
 
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_EXTENSIONS OFF)
 
 # Single-threaded examples
@@ -51,7 +49,9 @@ foreach(example
     ssl_client_cert
     encode_decode
     scheduled_send
-    service_bus)
+    service_bus
+    multithreaded_client
+    multithreaded_client_flow_control)
   add_executable(${example} ${example}.cpp)
   target_link_libraries(${example} Proton::cpp)
 endforeach()
@@ -63,11 +63,3 @@ if (ENABLE_OPENTELEMETRYCPP)
     target_link_libraries(${example} Proton::cpp opentelemetry-cpp::trace 
opentelemetry-cpp::otlp_http_exporter)
   endforeach()
 endif()
-
-# Examples that use threads directly
-foreach(example
-    multithreaded_client
-    multithreaded_client_flow_control)
-  add_executable(${example} ${example}.cpp)
-  target_link_libraries(${example} Proton::cpp Threads::Threads)
-endforeach()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to