From 232fff18d4f07aa25338da88ce704675f9fea465 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Tue, 6 Aug 2024 09:36:04 +0900 Subject: [PATCH 1/5] Fixed cmake warnings. --- CMakeLists.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dc6d610a..c75c908f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,12 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 3.1 FATAL_ERROR) - -CMAKE_POLICY (SET CMP0054 NEW) +if(${CMAKE_VERSION} VERSION_GREATER "3.4") + CMAKE_MINIMUM_REQUIRED (VERSION 3.5) +else() + CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12) + IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR + (CMAKE_VERSION VERSION_EQUAL 3.1)) + CMAKE_POLICY(SET CMP0054 NEW) + ENDIF () +endif() PROJECT (msgpack-cxx LANGUAGES CXX) @@ -67,6 +73,10 @@ IF (MSGPACK_32BIT) ENDIF () IF (MSGPACK_USE_BOOST) + IF ((CMAKE_VERSION VERSION_GREATER 3.30) OR + (CMAKE_VERSION VERSION_EQUAL 3.30)) + CMAKE_POLICY(SET CMP0167 NEW) + ENDIF () SET (Boost_USE_MULTITHREADED ON) IF (MSGPACK_USE_STATIC_BOOST) @@ -143,6 +153,10 @@ IF (MSGPACK_GEN_COVERAGE) ENDIF () IF (MSGPACK_BUILD_TESTS) + IF ((CMAKE_VERSION VERSION_GREATER 3.27) OR + (CMAKE_VERSION VERSION_EQUAL 3.27)) + CMAKE_POLICY(SET CMP0145 OLD) + ENDIF () IF (NOT MSGPACK_USE_BOOST) MESSAGE(FATAL_ERROR "Test requires -DMSGPACK_USE_BOOST=ON") ENDIF () From 22f6fa1cd201f98200885d8e29448a3ac55479cc Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Tue, 6 Aug 2024 10:48:45 +0900 Subject: [PATCH 2/5] Fixed brew update on CI. --- .github/workflows/gha.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gha.yml b/.github/workflows/gha.yml index 4abe45fe5..ac9e63989 100644 --- a/.github/workflows/gha.yml +++ b/.github/workflows/gha.yml @@ -21,6 +21,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Install Dependencies + run: | brew update brew install --force llvm From 636a0130ba4186b5f839edafa8988a3c3a5999b6 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Tue, 6 Aug 2024 11:21:55 +0900 Subject: [PATCH 3/5] Conditional include msgpack::variant. It uses boost::variant. boost::variant requires boost::tyoe_index. boost::type index has dropped C++03 support. --- include/msgpack/type.hpp | 4 ++++ test/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/msgpack/type.hpp b/include/msgpack/type.hpp index 1ab49745f..9ef3e86d3 100644 --- a/include/msgpack/type.hpp +++ b/include/msgpack/type.hpp @@ -73,7 +73,11 @@ #if !defined(MSGPACK_NO_BOOST) #include "adaptor/boost/fusion.hpp" + +#if !defined(MSGPACK_USE_CPP03) #include "adaptor/boost/msgpack_variant.hpp" +#endif // !defined(MSGPACK_USE_CPP03) + #include "adaptor/boost/optional.hpp" #include "adaptor/boost/string_ref.hpp" #include "adaptor/boost/string_view.hpp" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a0233dd35..b29c07a2c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,7 +8,6 @@ LIST (APPEND check_PROGRAMS boost_optional.cpp boost_string_ref.cpp boost_string_view.cpp - boost_variant.cpp buffer.cpp carray.cpp cases.cpp @@ -43,6 +42,7 @@ ENDIF () IF (MSGPACK_CXX11 OR MSGPACK_CXX14 OR MSGPACK_CXX17 OR MSGPACK_CXX20) LIST (APPEND check_PROGRAMS + boost_variant.cpp iterator_cpp11.cpp msgpack_cpp11.cpp reference_cpp11.cpp From 28cfb1ff81ecafe766007bb3d6c1da7b77e2679c Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Tue, 6 Aug 2024 11:38:49 +0900 Subject: [PATCH 4/5] Boost.Test has dropped C++03 support. msgpack-c adjusted it. --- .github/workflows/gha.yml | 4 ++-- CMakeLists.txt | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gha.yml b/.github/workflows/gha.yml index ac9e63989..0f9de4418 100644 --- a/.github/workflows/gha.yml +++ b/.github/workflows/gha.yml @@ -60,7 +60,7 @@ jobs: case ${{ matrix.pattern }} in 0) - export MSGPACK_CXX_VERSION="MSGPACK_CXX11=OFF" + export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" ;; 1) export API_VERSION=1 @@ -137,7 +137,7 @@ jobs: case ${{ matrix.pattern }} in 0) export CXX="clang++-10" - export MSGPACK_CXX_VERSION="MSGPACK_CXX11=OFF" + export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON" ;; 1) export CXX="g++-10" diff --git a/CMakeLists.txt b/CMakeLists.txt index c75c908f9..a6dd2bcd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}) LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") SET (GNUCXX_STD_SUPPORT_VERSION "4.3") -OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF) +OPTION (MSGPACK_CXX11 "Using c++11 compiler" ON) OPTION (MSGPACK_CXX14 "Using c++14 compiler" OFF) OPTION (MSGPACK_CXX17 "Using c++17 compiler" OFF) OPTION (MSGPACK_CXX20 "Using c++20 compiler" OFF) @@ -153,6 +153,9 @@ IF (MSGPACK_GEN_COVERAGE) ENDIF () IF (MSGPACK_BUILD_TESTS) + IF (${CMAKE_CXX_STANDARD} EQUAL 98) + MESSAGE (FATAL_ERROR "Tests requires C++11 or newer") + ENDIF () IF ((CMAKE_VERSION VERSION_GREATER 3.27) OR (CMAKE_VERSION VERSION_EQUAL 3.27)) CMAKE_POLICY(SET CMP0145 OLD) From 0605190fd33196fe378c89c03c1edb34d5b875e4 Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Tue, 6 Aug 2024 12:12:12 +0900 Subject: [PATCH 5/5] Removed C++03 builds from appveyor. --- appveyor.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index bcd23d817..cf7e44693 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,16 +6,6 @@ branches: environment: matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 - cpp11: -DMSGPACK_CXX11=OFF - msvc: '"Visual Studio 12 2013"' - boost_prefix: C:\Libraries\boost_1_58_0 - boost_subdir: lib32-msvc-12.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - cpp11: -DMSGPACK_CXX11=OFF - msvc: '"Visual Studio 14 2015"' - boost_prefix: C:\Libraries\boost_1_69_0 - boost_subdir: lib32-msvc-14.0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 cpp11: -DMSGPACK_CXX11=ON msvc: '"Visual Studio 14 2015"'