Skip to content

Commit

Permalink
Merge pull request #1133 from redboltz/fix_1132
Browse files Browse the repository at this point in the history
Fixed cmake warnings.
  • Loading branch information
redboltz committed Aug 6, 2024
2 parents 820ccf1 + 0605190 commit 5c606bd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/gha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
brew update
brew install --force llvm
Expand Down Expand Up @@ -59,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
Expand Down Expand Up @@ -136,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"
Expand Down
25 changes: 21 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -18,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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -143,6 +153,13 @@ 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)
ENDIF ()
IF (NOT MSGPACK_USE_BOOST)
MESSAGE(FATAL_ERROR "Test requires -DMSGPACK_USE_BOOST=ON")
ENDIF ()
Expand Down
10 changes: 0 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
Expand Down
4 changes: 4 additions & 0 deletions include/msgpack/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5c606bd

Please sign in to comment.