Skip to content

Commit 4022c2f

Browse files
committed
Fix appveyor build
1 parent 7b7615a commit 4022c2f

File tree

3 files changed

+52
-39
lines changed

3 files changed

+52
-39
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,15 @@ INSTALL (TARGETS msgpackc-cxx
178178

179179
# Install headers from source tree.
180180
INSTALL (DIRECTORY include/
181-
TYPE INCLUDE
181+
DESTINATION include
182182
COMPONENT msgpackc-cxx
183183
)
184184

185185
INCLUDE (CMakePackageConfigHelpers)
186186

187-
SET (extra_version_file_args ARCH_INDEPENDENT)
187+
IF (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
188+
SET (extra_version_file_args ARCH_INDEPENDENT)
189+
ENDIF ()
188190
SET (cmake_config_path "lib/cmake/msgpackc-cxx")
189191

190192
# Configure the main package file from source tree.

appveyor.yml

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,63 @@ branches:
44
only:
55
- cpp_master
66

7-
image:
8-
- Visual Studio 2015
97
environment:
10-
global:
11-
BOOST_ROOT: C:\Libraries\boost_1_67_0
128
matrix:
13-
- cpp11: -DMSGPACK_CXX11=OFF
14-
example: -DMSGPACK_BUILD_EXAMPLES=OFF
15-
msvc: '"Visual Studio 10 2010"'
16-
- cpp11: -DMSGPACK_CXX11=OFF
17-
example: -DMSGPACK_BUILD_EXAMPLES=OFF
18-
msvc: '"Visual Studio 11 2012"'
19-
- cpp11: -DMSGPACK_CXX11=OFF
20-
example: -DMSGPACK_BUILD_EXAMPLES=OFF
9+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
10+
cpp11: -DMSGPACK_CXX11=OFF
2111
msvc: '"Visual Studio 12 2013"'
22-
- cpp11: -DMSGPACK_CXX11=ON
23-
example: -DMSGPACK_BUILD_EXAMPLES=ON
12+
boost_prefix: C:\Libraries\boost_1_58_0
13+
boost_subdir: lib32-msvc-12.0
14+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
15+
cpp11: -DMSGPACK_CXX11=OFF
2416
msvc: '"Visual Studio 14 2015"'
25-
- cpp11: -DMSGPACK_CXX11=OFF
26-
example: -DMSGPACK_BUILD_EXAMPLES=ON
17+
boost_prefix: C:\Libraries\boost_1_69_0
18+
boost_subdir: lib32-msvc-14.0
19+
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
20+
cpp11: -DMSGPACK_CXX11=ON
2721
msvc: '"Visual Studio 14 2015"'
22+
boost_prefix: C:\Libraries\boost_1_69_0
23+
boost_subdir: lib32-msvc-14.0
2824
build_script:
2925
- ps: |
30-
appveyor DownloadFile https://github.com/google/googletest/archive/release-1.7.0.zip -FileName googletest-release-1.7.0.zip
31-
7z x googletest-release-1.7.0.zip 2> $null
32-
cd googletest-release-1.7.0
33-
md build
34-
cd build
35-
cmake -G $env:msvc -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS=/D_VARIADIC_MAX=10 ..
36-
cmake --build . --config Release
37-
cd ..
38-
cd ..
3926
appveyor DownloadFile http://zlib.net/zlib-1.2.11.tar.gz -FileName zlib-1.2.11.tar.gz
4027
7z x zlib-1.2.11.tar.gz 2> $null
4128
7z x zlib-1.2.11.tar 2> $null
4229
cd zlib-1.2.11
30+
4331
md build
32+
md prefix
4433
cd build
45-
cmake -G $env:msvc ..
46-
cmake --build . --config Release
47-
copy zconf.h ..
48-
cd ..
49-
cd ..
50-
if ($env:msvc -ne '"Visual Studio 14 2015"') {
51-
((Get-Content CMakeLists.txt) -replace "COMPONENTS chrono system OPTIONAL_COMPONENTS timer", "") | Set-Content -Path CMakeLists.txt
52-
}
34+
35+
cmake `
36+
-G $env:msvc `
37+
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11\prefix" `
38+
..
39+
if ($LastExitCode -ne 0) { exit $LastExitCode }
40+
41+
cmake --build . --target install --config Release
42+
if ($LastExitCode -ne 0) { exit $LastExitCode }
43+
cd ..\..
44+
5345
md build
46+
md prefix
5447
cd build
55-
cmake -G $env:msvc $env:cpp11 $env:example $env:x3_parse -DGTEST_LIBRARY="$env:APPVEYOR_BUILD_FOLDER\googletest-release-1.7.0\build\Release\gtest.lib" -DGTEST_MAIN_LIBRARY="$env:APPVEYOR_BUILD_FOLDER\googletest-release-1.7.0\build\Release\gtest_main.lib" -DGTEST_INCLUDE_DIR="$env:APPVEYOR_BUILD_FOLDER\googletest-release-1.7.0\include" -DZLIB_LIBRARY="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11\build\Release\zlib.lib" -DZLIB_INCLUDE_DIR="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11" -DCMAKE_CXX_FLAGS='"/D_VARIADIC_MAX=10 /EHsc"' ..
56-
cmake --build . --config Release -v
48+
49+
cmake `
50+
-G $env:msvc `
51+
$env:cpp11 `
52+
-D MSGPACK_BUILD_EXAMPLES=ON `
53+
-D MSGPACK_BUILD_TESTS=ON `
54+
-D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" `
55+
-D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11\prefix" `
56+
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" `
57+
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" `
58+
..
59+
if ($LastExitCode -ne 0) { exit $LastExitCode }
60+
61+
cmake --build . --config Release
62+
if ($LastExitCode -ne 0) { exit $LastExitCode }
5763
5864
test_script:
59-
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\googletest-release-1.7.0\build\Release;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release
60-
- ctest -V
65+
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
66+
- ctest -VV -C Release

test/boost_string_view.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#include "config.h"
1010
#endif
1111

12+
// Avoid empty test tree on boost 1.60 and lower
13+
BOOST_AUTO_TEST_CASE(dummy)
14+
{
15+
}
16+
1217
#if (BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 61
1318

1419
BOOST_AUTO_TEST_CASE(pack_convert_string_view)

0 commit comments

Comments
 (0)