Skip to content

Commit 6707b14

Browse files
committed
MB-24078: Initial support for building with MSVC 2017 CE
Change-Id: Ie47d404ad5d55e40e0dcc093890959fcae09ff22 Reviewed-on: http://review.couchbase.org/77331 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent 72e014c commit 6707b14

File tree

3 files changed

+85
-16
lines changed

3 files changed

+85
-16
lines changed

cmake/Modules/PlatformIntrospection.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ MACRO (_DETERMINE_PLATFORM var)
6565
ELSE (DEFINED CB_DOWNLOAD_DEPS_PLATFORM)
6666
SET (_plat ${CMAKE_SYSTEM_NAME})
6767
IF (_plat STREQUAL "Windows")
68-
IF (${MSVC_VERSION} EQUAL 1900)
69-
SET (_plat "windows_msvc2015")
70-
ELSE ()
71-
SET (_plat "windows_msvc")
68+
if (${MSVC_VERSION} LESS 1900)
69+
SET (_plat "windows_msvc")
70+
elseif (${MSVC_VERSION} LESS 1910)
71+
SET (_plat "windows_msvc2015")
72+
elseif (${MSVC_VERSION} EQUAL 1910)
73+
SET (_plat "windows_msvc2017")
74+
ELSE()
75+
MESSAGE(FATAL_ERROR "Unsupported MSVC version: ${MSVC_VERSION}")
7276
ENDIF ()
7377
ELSEIF (_plat STREQUAL "Darwin")
7478
SET (_plat "macosx")

deps/manifest.cmake

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@
1717
# check if this is a supported platform.
1818
#
1919
DECLARE_DEP (breakpad VERSION 20160926-cb1 PLATFORMS centos6 centos7 debian7 debian8 suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015)
20-
DECLARE_DEP (boost VERSION 1.62.0-cb3 PLATFORMS centos6 centos7 debian7 debian8 macosx suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015)
21-
DECLARE_DEP (curl VERSION 7.49.1-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015)
20+
DECLARE_DEP (boost VERSION 1.62.0-cb3 PLATFORMS centos6 centos7 debian7 debian8 macosx suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015 windows_msvc2017)
21+
DECLARE_DEP (curl VERSION 7.49.1-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015 windows_msvc2017)
2222
DECLARE_DEP (erlang VERSION R16B03-1-couchbase-cb3 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04)
23-
DECLARE_DEP (erlang VERSION R16B03-1-couchbase-cb4 PLATFORMS windows_msvc windows_msvc2015)
24-
DECLARE_DEP (flatbuffers VERSION 1.4.0-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015)
25-
DECLARE_DEP (icu4c VERSION 54.1.0 PLATFORMS windows_msvc windows_msvc2015)
23+
DECLARE_DEP (erlang VERSION R16B03-1-couchbase-cb4 PLATFORMS windows_msvc windows_msvc2015 windows_msvc2017)
24+
DECLARE_DEP (flatbuffers VERSION 1.4.0-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015 windows_msvc2017)
25+
DECLARE_DEP (icu4c VERSION 54.1.0 PLATFORMS windows_msvc windows_msvc2015 windows_msvc2017)
2626
DECLARE_DEP (icu4c VERSION 54.1-cb10 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04)
27-
DECLARE_DEP (jemalloc VERSION 4.1.0-cb2 PLATFORMS windows_msvc windows_msvc2015)
27+
DECLARE_DEP (jemalloc VERSION 4.1.0-cb2 PLATFORMS windows_msvc windows_msvc2015 windows_msvc2017)
2828
DECLARE_DEP (jemalloc VERSION 4.0.4-cb2 PLATFORMS freebsd sunos)
2929
DECLARE_DEP (jemalloc VERSION 4.3.1-cb2 PLATFORMS centos6 centos7 debian7 debian8 macosx suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04)
30-
DECLARE_DEP (json VERSION 1.1.0-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015)
31-
DECLARE_DEP (libevent VERSION 2.1.8-cb2 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015)
32-
DECLARE_DEP (openssl VERSION 1.0.2k-cb1 PLATFORMS windows_msvc windows_msvc2015)
30+
DECLARE_DEP (json VERSION 1.1.0-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015 windows_msvc2017)
31+
DECLARE_DEP (libevent VERSION 2.1.8-cb2 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015 windows_msvc2017)
32+
DECLARE_DEP (openssl VERSION 1.0.2k-cb1 PLATFORMS windows_msvc windows_msvc2015 windows_msvc2017)
3333
DECLARE_DEP (openssl_h VERSION 0.9.8za-cb1 PLATFORMS macosx)
34-
DECLARE_DEP (python-snappy VERSION c97d633 PLATFORMS windows_msvc windows_msvc2015)
34+
DECLARE_DEP (python-snappy VERSION c97d633 PLATFORMS windows_msvc windows_msvc2015 windows_msvc2017)
3535
DECLARE_DEP (python-snappy VERSION c97d633-cb1 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04)
36-
DECLARE_DEP (snappy VERSION 1.1.1 PLATFORMS windows_msvc windows_msvc2015)
36+
DECLARE_DEP (snappy VERSION 1.1.1 PLATFORMS windows_msvc windows_msvc2015 windows_msvc2017)
3737
DECLARE_DEP (snappy VERSION 1.1.1-cb2 PLATFORMS centos6 centos7 debian7 debian8 freebsd macosx sunos suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04)
38-
DECLARE_DEP (v8 VERSION 5.2-cb1 PLATFORMS centos6 centos7 debian7 debian8 suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015)
38+
DECLARE_DEP (v8 VERSION 5.2-cb1 PLATFORMS centos6 centos7 debian7 debian8 suse11.2 suse12.2 ubuntu12.04 ubuntu14.04 ubuntu16.04 windows_msvc windows_msvc2015 windows_msvc2017)
3939
# 5.2-cb2 was rebuilt just for MacOS
4040
DECLARE_DEP (v8 VERSION 5.2-cb2 PLATFORMS macosx)
4141
DECLARE_DEP (v8 VERSION 4.8-cb4 PLATFORMS sunos)

win32/msvc2017ce.bat

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@echo off
2+
3+
set tools_dir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build
4+
5+
if not defined source_root goto default_source_root
6+
7+
:target_arch
8+
if not defined target_arch goto default_target_arch
9+
10+
:setup_arch
11+
if /i "%target_arch%" == "amd64" goto setup_amd64
12+
13+
echo Unknown architecture: %target_arch%. Must be amd64
14+
set ERRORLEVEL=1
15+
goto eof
16+
17+
:default_source_root
18+
set source_root=%CD%
19+
echo source_root not set. It was automatically set to the current directory %source_root%.
20+
goto target_arch
21+
22+
:default_target_arch
23+
set target_arch=amd64
24+
echo target_arch is not set. It was automatically set to %target_arch%.
25+
goto setup_arch
26+
27+
:setup_amd64
28+
echo on
29+
echo Setting up Visual Studio environment for amd64
30+
call "%tools_dir%\vcvarsall.bat" amd64
31+
goto setup_environment
32+
33+
:setup_environment
34+
rem Unfortunately we need to have all of the directories
35+
rem we build dll's in in the path in order to run make
36+
rem test in a module..
37+
38+
echo Setting compile environment for building Couchbase server
39+
set OBJDIR=\build
40+
set MODULEPATH=%SOURCE_ROOT%%OBJDIR%\platform
41+
set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\platform\extmeta
42+
set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\platform\cbcompress
43+
set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\phosphor
44+
45+
set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\memcached
46+
set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\couchstore
47+
set MODULEPATH=%MODULEPATH%;%SOURCE_ROOT%%OBJDIR%\sigar\build-src
48+
set PATH=%MODULEPATH%;%PATH%;%SOURCE_ROOT%\install\bin
49+
set OBJDIR=
50+
SET MODULEPATH=
51+
cd %SOURCE_ROOT%
52+
if "%target_arch%" == "amd64" set PATH=%PATH%;%SOURCE_ROOT%\install\x86\bin
53+
goto eof
54+
55+
:missing_root
56+
echo source_root should be set in the source root
57+
set ERRORLEVEL=1
58+
goto eof
59+
60+
:missing_target_arch
61+
echo target_arch must be set in environment to x86 or amd64
62+
set ERRORLEVEL=1
63+
goto eof
64+
65+
:eof

0 commit comments

Comments
 (0)