summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. King III <jking@apache.org>2019-01-11 12:17:44 -0500
committerJames E. King III <jking@apache.org>2019-01-11 20:47:00 -0500
commit278528cf7b1dd5dd977bce882aa126fac8695697 (patch)
tree311f723983babe76272a4cedc3bdd2d1b6428413
parent76ee393d20044f7bf930611cf8fc370acb8e9e1a (diff)
downloadthrift-278528cf7b1dd5dd977bce882aa126fac8695697.tar.gz
THRIFT-4732: windows cmake refinements and add windows docker build support
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xappveyor.yml7
-rw-r--r--build/appveyor/CYGW-appveyor-build.bat4
-rw-r--r--build/appveyor/MING-appveyor-build.bat4
-rw-r--r--build/appveyor/MSVC-appveyor-build.bat6
-rw-r--r--build/appveyor/cl_setenv.bat23
-rw-r--r--build/cmake/DefineOptions.cmake50
-rw-r--r--build/cmake/DefinePlatformSpecifc.cmake25
-rw-r--r--build/cmake/README.md46
-rw-r--r--build/cmake/ThriftMacros.cmake76
-rw-r--r--build/docker/msvc2017/Dockerfile96
-rw-r--r--build/docker/msvc2017/README.md50
-rw-r--r--build/docker/msvc2017/build-compiler.bat44
-rw-r--r--build/docker/msvc2017/build.bat44
-rw-r--r--build/wincpp/README.md219
-rw-r--r--build/wincpp/build-thrift-compiler.bat79
-rw-r--r--build/wincpp/build-thrift.bat163
-rw-r--r--build/wincpp/scripts/cl_setarch.bat47
-rw-r--r--build/wincpp/scripts/cl_setcompiler.bat58
-rw-r--r--build/wincpp/scripts/cl_setgenerator.bat69
-rw-r--r--build/wincpp/scripts/tpversions.bat24
-rw-r--r--build/wincpp/thirdparty/src/build-libevent.bat86
-rw-r--r--build/wincpp/thirdparty/src/build-openssl.bat106
-rw-r--r--build/wincpp/thirdparty/src/build-zlib.bat75
-rw-r--r--compiler/cpp/CMakeLists.txt52
-rw-r--r--compiler/cpp/test/CMakeLists.txt30
-rwxr-xr-xlib/cpp/CMakeLists.txt2
-rwxr-xr-xlib/cpp/README.md9
-rw-r--r--lib/cpp/src/thrift/TOutput.cpp2
-rw-r--r--lib/cpp/src/thrift/TOutput.h2
-rw-r--r--lib/cpp/src/thrift/protocol/TJSONProtocol.cpp4
31 files changed, 384 insertions, 1120 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6dd5638b..e67916465 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@
# under the License.
#
-cmake_minimum_required(VERSION 3.3)
+cmake_minimum_required(VERSION 3.4)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW) # package version behavior added in cmake 3.0
diff --git a/appveyor.yml b/appveyor.yml
index ab6f582ea..4c0144cdc 100755
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -23,6 +23,11 @@ version: '1.0.0.{build}'
shallow_clone: true
+branches:
+ only:
+ - master
+ - /^(release/)?\d+\.\d+\.\d+$/
+
os:
- Visual Studio 2017
@@ -36,6 +41,7 @@ environment:
- PROFILE: MSVC2017
PLATFORM: x64
CONFIGURATION: Release
+ BUILD_SHARED_LIBS: OFF
BOOST_VERSION: 1.67.0
LIBEVENT_VERSION: 2.1.8
PYTHON_VERSION: 3.6
@@ -46,6 +52,7 @@ environment:
- PROFILE: MSVC2015
PLATFORM: x86
CONFIGURATION: Release
+ BUILD_SHARED_LIBS: OFF
BOOST_VERSION: 1.62.0
LIBEVENT_VERSION: 2.0.22
PYTHON_VERSION: 3.5
diff --git a/build/appveyor/CYGW-appveyor-build.bat b/build/appveyor/CYGW-appveyor-build.bat
index 6d57ca30d..fbcc84b0c 100644
--- a/build/appveyor/CYGW-appveyor-build.bat
+++ b/build/appveyor/CYGW-appveyor-build.bat
@@ -26,9 +26,7 @@ SET CMAKEARGS=^
-DCMAKE_CXX_EXTENSIONS=ON ^
-DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" ^
-DCMAKE_CXX_STANDARD=11 ^
- -DWITH_PYTHON=OFF ^
- -DWITH_SHARED_LIB=OFF ^
- -DWITH_STATIC_LIB=ON
+ -DWITH_PYTHON=OFF
@ECHO ON
%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% %CMAKEARGS% && cmake --build . --config %CONFIGURATION% --target install" || EXIT /B
diff --git a/build/appveyor/MING-appveyor-build.bat b/build/appveyor/MING-appveyor-build.bat
index b37a95a79..eec65f897 100644
--- a/build/appveyor/MING-appveyor-build.bat
+++ b/build/appveyor/MING-appveyor-build.bat
@@ -27,9 +27,7 @@ SET CMAKEARGS=^
-DCMAKE_C_COMPILER=/mingw%NORM_PLATFORM%/bin/gcc.exe ^
-DCMAKE_CXX_COMPILER=/mingw%NORM_PLATFORM%/bin/g++.exe ^
-DOPENSSL_ROOT_DIR=/mingw%NORM_PLATFORM% ^
- -DWITH_PYTHON=OFF ^
- -DWITH_SHARED_LIB=OFF ^
- -DWITH_STATIC_LIB=ON
+ -DWITH_PYTHON=OFF
@ECHO ON
%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% %CMAKEARGS% && cmake --build . --config %CONFIGURATION% --target install" || EXIT /B
diff --git a/build/appveyor/MSVC-appveyor-build.bat b/build/appveyor/MSVC-appveyor-build.bat
index 0b7f0ef23..892daa17a 100644
--- a/build/appveyor/MSVC-appveyor-build.bat
+++ b/build/appveyor/MSVC-appveyor-build.bat
@@ -42,19 +42,17 @@ CD "%BUILDDIR%" || EXIT /B
-DBISON_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_bison.exe ^
-DBOOST_ROOT="%BOOST_ROOT%" ^
-DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" ^
+ -DBUILD_SHARED_LIBS="%BUILD_SHARED_LIBS%" ^
-DCMAKE_BUILD_TYPE="%CONFIGURATION%" ^
-DCMAKE_INSTALL_PREFIX="%INSTDIR%" ^
-DFLEX_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison3\tools\win_flex.exe ^
- -DINTTYPES_ROOT="%WIN3P%\msinttypes" ^
-DLIBEVENT_ROOT="%WIN3P%\libevent-%LIBEVENT_VERSION%-stable" ^
-DOPENSSL_ROOT_DIR="%OPENSSL_ROOT%" ^
-DOPENSSL_USE_STATIC_LIBS=OFF ^
-DZLIB_LIBRARY="%WIN3P%\zlib-inst\lib\zlib%ZLIB_LIB_SUFFIX%.lib" ^
-DZLIB_ROOT="%WIN3P%\zlib-inst" ^
-DWITH_PYTHON=%WITH_PYTHON% ^
- -DWITH_%THREADMODEL%THREADS=ON ^
- -DWITH_SHARED_LIB=OFF ^
- -DWITH_STATIC_LIB=ON || EXIT /B
+ -DWITH_%THREADMODEL%THREADS=ON || EXIT /B
@ECHO OFF
cmake --build . ^
diff --git a/build/appveyor/cl_setenv.bat b/build/appveyor/cl_setenv.bat
index c33366d69..da4d4ee4f 100644
--- a/build/appveyor/cl_setenv.bat
+++ b/build/appveyor/cl_setenv.bat
@@ -107,15 +107,18 @@ IF "%PROFILE:~0,4%" == "MSVC" (
GOTO :EOF
:SETUPNEWERMSVC
- FOR /F "USEBACKQ TOKENS=*" %%i IN (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[15.0,16.0)" -property installationPath`) DO (
- IF "%MSVCROOT%" == "" (SET MSVCROOT=%%i)
+ :: If VsDevCmd.bat has already executed, as is the case in the
+ :: msvc2017 docker container, skip this...
+ IF NOT DEFINED VSCMD_VER (
+ FOR /F "USEBACKQ TOKENS=*" %%i IN (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[15.0,16.0)" -property installationPath`) DO (
+ IF "%MSVCROOT%" == "" (SET MSVCROOT=%%i)
+ )
+ SET MSVCPLAT=x86
+ IF "%PLATFORM%" == "x64" (SET MSVCPLAT=amd64)
+
+ SET CURRENTDIR=%CD%
+ CALL "!MSVCROOT!\Common7\Tools\VsDevCmd.bat" -arch=!MSVCPLAT! || EXIT /B
+ CD %CURRENTDIR%
+ EXIT /B
)
- SET MSVCPLAT=x86
- IF "%PLATFORM%" == "x64" (SET MSVCPLAT=amd64)
-
- SET CURRENTDIR=%CD%
- CALL "!MSVCROOT!\Common7\Tools\VsDevCmd.bat" -arch=!MSVCPLAT! || EXIT /B
- CD %CURRENTDIR%
- EXIT /B
-
:EOF
diff --git a/build/cmake/DefineOptions.cmake b/build/cmake/DefineOptions.cmake
index 9d95b7c74..19cb104e8 100644
--- a/build/cmake/DefineOptions.cmake
+++ b/build/cmake/DefineOptions.cmake
@@ -28,8 +28,8 @@ option(BUILD_COMPILER "Build Thrift compiler" ON)
if(BUILD_COMPILER OR EXISTS ${THRIFT_COMPILER})
set(HAVE_COMPILER ON)
endif()
-CMAKE_DEPENDENT_OPTION(BUILD_TESTING "Build with unit tests" ON "HAVE_COMPILER" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_EXAMPLES "Build examples" ON "HAVE_COMPILER" OFF)
+CMAKE_DEPENDENT_OPTION(BUILD_TESTING "Build with unit tests" ON "HAVE_COMPILER" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_TUTORIALS "Build Thrift tutorials" ON "HAVE_COMPILER" OFF)
option(BUILD_LIBRARIES "Build Thrift libraries" ON)
@@ -40,9 +40,7 @@ option(BUILD_LIBRARIES "Build Thrift libraries" ON)
# and enables the library if all are found. This means the default is to build as
# much as possible but leaving out libraries if their dependencies are not met.
-option(WITH_BOOST_STATIC "Build with Boost static link library" OFF)
-set(Boost_USE_STATIC_LIBS ${WITH_BOOST_STATIC})
-if (NOT WITH_BOOST_STATIC)
+if (NOT Boost_USE_STATIC_LIBS)
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-DBOOST_TEST_DYN_LINK)
endif()
@@ -113,7 +111,7 @@ option(WITH_PYTHON "Build Python Thrift library" ON)
find_package(PythonInterp QUIET) # for Python executable
find_package(PythonLibs QUIET) # for Python.h
CMAKE_DEPENDENT_OPTION(BUILD_PYTHON "Build Python library" ON
- "BUILD_LIBRARIES;WITH_PYTHON;PYTHONLIBS_FOUND" OFF)
+ "BUILD_LIBRARIES;WITH_PYTHON;PYTHONINTERP_FOUND;PYTHONLIBS_FOUND" OFF)
# Haskell
option(WITH_HASKELL "Build Haskell Thrift library" ON)
@@ -123,22 +121,29 @@ CMAKE_DEPENDENT_OPTION(BUILD_HASKELL "Build GHC library" ON
"BUILD_LIBRARIES;WITH_HASKELL;GHC_FOUND;CABAL_FOUND" OFF)
# Common library options
-option(WITH_SHARED_LIB "Build shared libraries" ON)
-option(WITH_STATIC_LIB "Build static libraries" ON)
-if (NOT WITH_SHARED_LIB AND NOT WITH_STATIC_LIB)
- message(FATAL_ERROR "Cannot build with both shared and static outputs disabled!")
-endif()
-
-#NOTE: C++ compiler options are defined in the lib/cpp/CMakeLists.txt
+# https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
+# Default on Windows is static, shared mode library support needs work...
+CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF "WIN32" ON)
+
+if (WITH_SHARED_LIB)
+ message(WARNING "WITH_SHARED_LIB is deprecated; use -DBUILD_SHARED_LIBS=ON instead")
+ set(BUILD_SHARED_LIBS ON)
+elseif (WITH_STATIC_LIB)
+ if (WITH_SHARED_LIB)
+ message(FATAL_ERROR "Cannot build shared and static together; set BUILD_SHARED_LIBS instead.")
+ endif ()
+ message(WARNING "WITH_STATIC_LIB is deprecated; use -DBUILD_SHARED_LIBS=OFF instead")
+ set(BUILD_SHARED_LIBS OFF)
+endif ()
# Visual Studio only options
if(MSVC)
-option(WITH_MT "Build using MT instead of MD (MSVC only)" OFF)
+ option(WITH_MT "Build using MT instead of MD (MSVC only)" OFF)
endif(MSVC)
macro(MESSAGE_DEP flag summary)
if(NOT ${flag})
- message(STATUS " - ${summary}")
+ message(STATUS " - ${summary}")
endif()
endmacro(MESSAGE_DEP flag summary)
@@ -176,14 +181,13 @@ message(STATUS " Build Haskell library: ${BUILD_HASKELL}")
MESSAGE_DEP(WITH_HASKELL "Disabled by WITH_HASKELL=OFF")
MESSAGE_DEP(GHC_FOUND "GHC missing")
MESSAGE_DEP(CABAL_FOUND "Cabal missing")
-message(STATUS " Library features:")
-message(STATUS " Build shared libraries: ${WITH_SHARED_LIB}")
-message(STATUS " Build static libraries: ${WITH_STATIC_LIB}")
-message(STATUS " Build with Boost static link library: ${WITH_BOOST_STATIC}")
-message(STATUS " Build with libevent support: ${WITH_LIBEVENT}")
-message(STATUS " Build with OpenSSL support: ${WITH_OPENSSL}")
-message(STATUS " Build with Qt4 support: ${WITH_QT4}")
-message(STATUS " Build with Qt5 support: ${WITH_QT5}")
-message(STATUS " Build with ZLIB support: ${WITH_ZLIB}")
+if (BUILD_CPP)
+ message(STATUS " Library features:")
+ message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}")
+ message(STATUS " Build with libevent support: ${WITH_LIBEVENT}")
+ message(STATUS " Build with Qt4 support: ${WITH_QT4}")
+ message(STATUS " Build with Qt5 support: ${WITH_QT5}")
+ message(STATUS " Build with ZLIB support: ${WITH_ZLIB}")
+endif ()
message(STATUS "----------------------------------------------------------")
endmacro(PRINT_CONFIG_SUMMARY)
diff --git a/build/cmake/DefinePlatformSpecifc.cmake b/build/cmake/DefinePlatformSpecifc.cmake
index 9d7c9030c..ac33e2900 100644
--- a/build/cmake/DefinePlatformSpecifc.cmake
+++ b/build/cmake/DefinePlatformSpecifc.cmake
@@ -20,8 +20,16 @@
# Uncomment this to show some basic cmake variables about platforms
# include (NewPlatformDebug)
+# For Debug build types, append a "d" to the library names.
+set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
+
# Visual Studio specific options
if(MSVC)
+ # Allow for shared library builds
+ if(BUILD_SHARED_LIBS)
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON CACHE TYPE BOOL FORCE)
+ endif()
+
#For visual studio the library naming is as following:
# Dynamic libraries:
# - thrift.dll for release library
@@ -36,11 +44,6 @@ if(MSVC)
#
# the same holds for other libraries like libthriftz etc.
- # For Debug build types, append a "d" to the library names.
- set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
- set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set release library postfix" FORCE)
- set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "Set release library postfix" FORCE)
-
# Build using /MT option instead of /MD if the WITH_MT options is set
if(WITH_MT)
set(CompilerFlags
@@ -56,9 +59,9 @@ if(MSVC)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
- set(STATIC_POSTFIX "mt" CACHE STRING "Set static library postfix" FORCE)
+ set(THRIFT_RUNTIME_POSTFIX "mt" CACHE STRING "Set static library postfix" FORCE)
else(WITH_MT)
- set(STATIC_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE)
+ set(THRIFT_RUNTIME_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE)
endif(WITH_MT)
# Disable boost auto linking pragmas - cmake includes the right files
@@ -72,14 +75,6 @@ if(MSVC)
add_definitions("/MP") # parallel build
add_definitions("/W3") # warning level 3
-
- # VS2010 does not provide inttypes which we need for "PRId64" used in many places
- find_package(Inttypes)
- if (Inttypes_FOUND)
- include_directories(${INTTYPES_INCLUDE_DIRS})
- # OpenSSL conflicts with the definition of PRId64 unless it is defined first
- add_definitions("/FIinttypes.h")
- endif ()
elseif(UNIX)
find_program( MEMORYCHECK_COMMAND valgrind )
set( MEMORYCHECK_COMMAND_OPTIONS "--gen-suppressions=all --leak-check=full" )
diff --git a/build/cmake/README.md b/build/cmake/README.md
index e5c128bc3..a0eb859bd 100644
--- a/build/cmake/README.md
+++ b/build/cmake/README.md
@@ -1,6 +1,7 @@
-# Apache Thrift - CMake build
+# Apache Thrift - CMake Build
## Goal
+
Extend Apache Thrift's *make cross* approach to the build system.
Due to growing the field of operating system support, a proper executable
@@ -11,12 +12,26 @@ package generation process.
As nice side benefit of CMake is the generation of development environment
specific soultion files. => No solution files within source tree.
+## Prerequisites
+
+These are language-specific, however for C++ you must provide:
+
+- Boost
+- OpenSSL
+
+You may optionally provide:
+
+- libevent
+- zlib
## Usage
-just do this:
- mkdir cmake-build && cd cmake-build
- cmake ..
+To use CMake you first create an out-of-tree build directory, then use
+CMake to generate a build framework, then build:
+
+ mkdir /tmp/build
+ cd /tmp/build
+ cmake /location/to/thrift
if you use a specific toolchain pass it to cmake, the same for options:
@@ -25,13 +40,6 @@ if you use a specific toolchain pass it to cmake, the same for options:
cmake -DTHRIFT_COMPILER_HS=OFF ..
cmake -DWITH_ZLIB=ON ..
-or on Windows
-
- cmake -G "Visual Studio 12 2013 Win64" \
- -DBOOST_ROOT=C:/3rdparty/boost_1_58_0 \
- -DZLIB_ROOT=C:/3rdparty/zlib128-dll \
- -DWITH_SHARED_LIB=off ..
-
and open the development environment you like with the solution or do this:
make
@@ -39,15 +47,25 @@ and open the development environment you like with the solution or do this:
make cross
make dist
-to generate an installer and distribution package do this:
+or on Windows, the following will produce a solution file you can use
+inside Visual Studio:
+
+ cmake -G "Visual Studio 15 2017 Win64" \
+ -DBOOST_ROOT=C:/3rdparty/boost_1_69_0 \
+ -DBOOST_LIBRARYDIR=C:/3rdparty/boost_1_69_0/lib64-msvc-14.1^
+ -DZLIB_ROOT=C:/3rdparty/zlib-1.2.11
+
+<!--
+To generate an installer and distribution package do this:
cpack
+-->
## TODO
+
* git hash or tag based versioning depending on source state
* build tutorial
* build test
-* with/without language lib/<lang>/
* enable/disable
* make cross
* make dist (create an alias to make package_source)
@@ -57,4 +75,4 @@ to generate an installer and distribution package do this:
* libthrift
* tutorial
* test
-* merge into /README.md
+* merge into /README.md \ No newline at end of file
diff --git a/build/cmake/ThriftMacros.cmake b/build/cmake/ThriftMacros.cmake
index f837f9482..366719fbb 100644
--- a/build/cmake/ThriftMacros.cmake
+++ b/build/cmake/ThriftMacros.cmake
@@ -17,89 +17,31 @@
# under the License.
#
-
-set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
-
-
macro(ADD_LIBRARY_THRIFT name)
-
-if(WITH_SHARED_LIB)
- add_library(${name} SHARED ${ARGN})
+ add_library(${name} ${ARGN})
set_target_properties(${name} PROPERTIES
- OUTPUT_NAME ${name}
- VERSION ${thrift_VERSION}
- SOVERSION ${thrift_VERSION} )
- #set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}")
+ OUTPUT_NAME ${name}${THRIFT_RUNTIME_POSTFIX} # windows link variants (/MT, /MD, /MTd, /MDd) get different names
+ VERSION ${thrift_VERSION} )
+ # set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}")
install(TARGETS ${name}
RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
-endif()
-
-if(WITH_STATIC_LIB)
- add_library(${name}_static STATIC ${ARGN})
- set_target_properties(${name}_static PROPERTIES
- OUTPUT_NAME ${name}${STATIC_POSTFIX}
- VERSION ${thrift_VERSION}
- SOVERSION ${thrift_VERSION} )
- install(TARGETS ${name}_static
- RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
- LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
- ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
- PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
-endif()
-
-endmacro(ADD_LIBRARY_THRIFT)
-
+endmacro()
macro(TARGET_INCLUDE_DIRECTORIES_THRIFT name)
-
-if(WITH_SHARED_LIB)
target_include_directories(${name} ${ARGN})
-endif()
-
-if(WITH_STATIC_LIB)
- target_include_directories(${name}_static ${ARGN})
-endif()
-
-endmacro(TARGET_INCLUDE_DIRECTORIES_THRIFT)
-
+endmacro()
macro(TARGET_LINK_LIBRARIES_THRIFT name)
-
-if(WITH_SHARED_LIB)
target_link_libraries(${name} ${ARGN})
-endif()
-
-if(WITH_STATIC_LIB)
- target_link_libraries(${name}_static ${ARGN})
-endif()
-
-endmacro(TARGET_LINK_LIBRARIES_THRIFT)
-
+endmacro()
macro(LINK_AGAINST_THRIFT_LIBRARY target libname)
-
-if (WITH_SHARED_LIB)
target_link_libraries(${target} ${libname})
-elseif (WITH_STATIC_LIB)
- target_link_libraries(${target} ${libname}_static)
-else()
- message(FATAL "Not linking with shared or static libraries?")
-endif()
-
-endmacro(LINK_AGAINST_THRIFT_LIBRARY)
-
+endmacro()
macro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY target libname)
-
-if(WITH_SHARED_LIB)
target_link_libraries(${target} ${ARGN} ${libname})
-endif()
-
-if(WITH_STATIC_LIB)
- target_link_libraries(${target}_static ${ARGN} ${libname}_static)
-endif()
-
-endmacro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY)
+endmacro()
diff --git a/build/docker/msvc2017/Dockerfile b/build/docker/msvc2017/Dockerfile
new file mode 100644
index 000000000..7da895cb5
--- /dev/null
+++ b/build/docker/msvc2017/Dockerfile
@@ -0,0 +1,96 @@
+# escape=`
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM microsoft/dotnet-framework:4.7.1
+
+# Restore the default Windows shell for correct batch processing below.
+SHELL ["cmd", "/S", "/C"]
+
+# Install Build Tools excluding workloads and components with known issues.
+ADD https://aka.ms/vs/15/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
+RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
+ --installPath C:\BuildTools `
+ --all `
+ --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 `
+ --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 `
+ --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 `
+ --remove Microsoft.VisualStudio.Component.Windows81SDK `
+ || IF "%ERRORLEVEL%"=="3010" EXIT 0
+RUN DEL C:\TEMP\vs_buildtools.exe
+
+# Install CMake
+ADD https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-win64-x64.msi C:\TEMP\cmake.msi
+RUN msiexec.exe /i C:\TEMP\cmake.msi /qn && `
+ SETX PATH "%PATH%;C:\Program Files\CMake\bin" && `
+ DEL C:\TEMP\cmake.msi
+
+# Install boost (for the thrift runtime library build)
+ADD https://boost.teeks99.com/bin/1.69.0/boost_1_69_0-msvc-14.1-64.exe C:\TEMP\boost.exe
+RUN C:\TEMP\boost.exe /DIR="C:\Libraries\boost_1_69_0" /SILENT && `
+ DEL C:\TEMP\boost.exe
+
+# Install chocolatey
+RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" `
+ -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command `
+ "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" `
+ && SETX PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
+
+# Install winflexbison (for the thrift compiler build)
+RUN choco install winflexbison3 -y
+
+# Install 7zip and curl (used by the libevent and zlib build scripts)
+RUN choco install 7zip curl -y
+
+# Install libevent
+COPY appveyor\build-libevent.bat C:\TEMP\build-libevent.bat
+ENV LIBEVENT_VERSION=2.1.8
+ENV WIN3P=C:\TEMP\WIN3P
+RUN C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 && `
+ MKDIR C:\TEMP\WIN3P && `
+ C:\TEMP\build-libevent.bat && `
+ MKDIR C:\Libraries\libevent-%LIBEVENT_VERSION% && `
+ MOVE C:\TEMP\WIN3P\libevent-%LIBEVENT_VERSION%-stable\include C:\Libraries\libevent-%LIBEVENT_VERSION% && `
+ MOVE C:\TEMP\WIN3P\libevent-%LIBEVENT_VERSION%-stable\lib C:\Libraries\libevent-%LIBEVENT_VERSION% && `
+ RMDIR /S /Q C:\TEMP\WIN3P
+
+# Install zlib
+COPY appveyor\build-zlib.bat C:\TEMP\build-zlib.bat
+ENV ZLIB_VERSION=1.2.11
+ENV WIN3P=C:\TEMP\WIN3P
+RUN C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 && `
+ MKDIR C:\TEMP\WIN3P && `
+ C:\TEMP\build-zlib.bat && `
+ MOVE C:\TEMP\WIN3P\zlib-inst C:\Libraries\zlib-%ZLIB_VERSION% && `
+ RMDIR /S /Q C:\TEMP\WIN3P
+
+# Install OpenSSL 1.1.0
+ADD http://slproweb.com/download/Win64OpenSSL-1_1_0j.exe C:\TEMP\openssl.exe
+RUN C:\TEMP\openssl.exe /silent && `
+ DEL C:\TEMP\openssl.exe
+
+# Install java
+RUN choco install jdk8 -y
+
+# Install haskell
+RUN choco install ghc -y
+
+# Install python3
+RUN choco install python3 -y
+
+# Start developer command prompt with any other commands specified.
+ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 &&
+
+# Default to PowerShell if no other command specified.
+CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] \ No newline at end of file
diff --git a/build/docker/msvc2017/README.md b/build/docker/msvc2017/README.md
new file mode 100644
index 000000000..0c882d747
--- /dev/null
+++ b/build/docker/msvc2017/README.md
@@ -0,0 +1,50 @@
+# Building Thrift using Docker for Windows
+
+The build image is very large (just under 30GB) so plan accordingly.
+Once Microsoft supports build tools in nano, it should get better.
+
+Install Docker for Windows and switch to Windows container mode.
+
+Pull from docker hub:
+
+ PS C:\> docker pull thrift/thrift-build:msvc2017
+
+or build in a docker for windows environment:
+
+ PS C:\Thrift> docker build -t thrift/thrift-build:msvc2017 -f build\docker\msvc2017\Dockerfile build\
+
+The following directories are used inside the container:
+
+ C:\Build the out-of-tree build directory
+ C:\Install the install target directory
+ C:\Thrift the source tree
+
+You can override these as docker volumes if desired.
+
+### Compiler
+
+To build a portable windows thrift compiler (with a statically linked
+runtime) and get it placed into C:\install:
+
+ docker run -v C:\thrift:C:\thrift^
+ -v C:\install:C:\install^
+ --rm -t thrift/thrift-build:msvc2017^
+ C:\thrift\build\docker\msvc2017\build-compiler.bat
+
+The end result is a portable windows thrift compiler located at
+
+ C:\Install\bin\thrift.exe
+
+If you run it through the [Dependency Walker](http://www.dependencywalker.com/)
+you will see it only depends on KERNEL32.DLL which means the runtime is statically
+linked, so the executable is portable and self-contained. This is how the
+windows thrift compiler is built for each Apache Thrift release.
+
+### Libraries
+
+To build, test everything and get the C++ SDK placed into C:\install:
+
+ docker run -v C:\thrift:C:\thrift^
+ -v C:\install:C:\install^
+ -m 4096 --rm -t thrift/thrift-build:msvc2017^
+ C:\thrift\build\docker\msvc2017\build.bat \ No newline at end of file
diff --git a/build/docker/msvc2017/build-compiler.bat b/build/docker/msvc2017/build-compiler.bat
new file mode 100644
index 000000000..5534428b4
--- /dev/null
+++ b/build/docker/msvc2017/build-compiler.bat
@@ -0,0 +1,44 @@
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+
+::
+:: Build script example for inside the windows docker container
+::
+:: C:\build is the out-of-tree build directory
+:: C:\install is the location where artifacts are placed
+:: C:\thrift is where the sources are
+::
+
+:: Make and go into the out-of-tree directory
+IF NOT EXIST C:\build (MKDIR C:\build)
+cd c:\build
+
+:: Generate the out-of-tree build files
+cmake^
+ -DBOOST_ROOT=C:\Libraries\boost_1_69_0^
+ -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_69_0\lib64-msvc-14.1^
+ -DBUILD_LIBRARIES=OFF^
+ -DCMAKE_BUILD_TYPE=Release^
+ -DCMAKE_INSTALL_PREFIX=C:\install^
+ -DWITH_MT=ON^
+ c:\thrift || EXIT /B
+
+:: Build
+cmake --build . --target thrift-compiler --config Release || EXIT /B
+
+:: Test
+cmake --build . --target check || EXIT /B
+
+:: Install
+cmake --build . --target install \ No newline at end of file
diff --git a/build/docker/msvc2017/build.bat b/build/docker/msvc2017/build.bat
new file mode 100644
index 000000000..ac7b68a1c
--- /dev/null
+++ b/build/docker/msvc2017/build.bat
@@ -0,0 +1,44 @@
+::
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::
+:: http://www.apache.org/licenses/LICENSE-2.0
+::
+:: Unless required by applicable law or agreed to in writing, software
+:: distributed under the License is distributed on an "AS IS" BASIS,
+:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+:: See the License for the specific language governing permissions and
+:: limitations under the License.
+::
+
+::
+:: Build script example for inside the windows docker container
+::
+:: C:\build is the out-of-tree build directory
+:: C:\install is the location where artifacts are placed
+:: C:\thrift is where the sources are
+::
+
+:: Make and go into the out-of-tree directory
+IF NOT EXIST C:\build (MKDIR C:\build)
+cd c:\build
+
+:: Generate the out-of-tree build files
+cmake^
+ -DBOOST_ROOT=C:\Libraries\boost_1_69_0^
+ -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_69_0\lib64-msvc-14.1^
+ -DLIBEVENT_ROOT=C:\Libraries\libevent-2.1.8^
+ -DZLIB_ROOT=C:\Libraries\zlib-1.2.11^
+ -DCMAKE_BUILD_TYPE=Release^
+ -DCMAKE_INSTALL_PREFIX=C:\install^
+ c:\thrift || EXIT /B
+
+:: Build
+cmake --build . --config Release || EXIT /B
+
+:: Test
+cmake --build . --target check || EXIT /B
+
+:: Install
+cmake --build . --target install \ No newline at end of file
diff --git a/build/wincpp/README.md b/build/wincpp/README.md
deleted file mode 100644
index a23178040..000000000
--- a/build/wincpp/README.md
+++ /dev/null
@@ -1,219 +0,0 @@
-<!---
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-# Building thrift on Windows (Native)
-
-Thrift uses cmake to make it easier to build the project on multiple platforms, however to build a fully functional and production ready thrift on Windows requires a number of third party libraries to be obtained or built. Once third party libraries are ready, the right combination of options must be passed to cmake in order to generate the correct environment.
-
-## Summary
-
-These instructions will help you build thrift for windows using Visual
-Studio 2010 or later. The contributed batch files will help you build
-the third party libraries needed for complete thrift functionality as
-well as thrift itself.
-
-These instructions follow a directory layout that looks like the following:
-
- workspace\
- build\ - this is where the out-of-tree thrift cmake builds are generated
- dist\ - this is where the thrift build results end up
- thirdparty\ - this is where all third party binaries and libraries live
- build\ - this is where all third party out-of-tree builds are generated
- (except for openssl, which only builds in-tree)
- dist\ - this is where all third party distributions end up
- src\ - this is where all third party source projects live
- scripts\ - batch files used to set environment variables for builds
- thrift\ - this is where the thrift source project lives
-
-Create a "workspace" directory somewhere on your system and then copy the contents of this
-directory to there, then clone or unpack thrift into `workspace\thrift`.
-
-## Third Party Libraries
-
-Batch scripts are provided to build some third party libraries. You must download them and place them into the directory noted for each. You can use different versions if you prefer; these instructions were made with the versions listed.
-
-> TIP: To modify the versions used in the batch scripts, look in scripts\tpversions.bat.
-
-Build them in the order listed to satisfy their dependencies.
-
-### winflexbison
-
- source: web site
- location: https://sourceforge.net/projects/winflexbison/files/win_flex_bison-latest.zip/download
- version: "latest"
- directory: workspace\thirdparty\dist\winflexbison
-
-This package is required to build the compiler. This third party package does not need to be built as it is a binary distribution of the "bison" and "flex" tools normally found on Unix boxes.
-
-> TIP: If you are only interested in building the compiler, you can skip the remaining third party libraries.
-
-### zlib
-
- source: web site
- location: http://zlib.net/
- version: 1.2.9
- directory: workspace\thirdparty\src\zlib-1.2.9
-
-To build, open the appropriate Visual Studio command prompt and then run
-the build-zlib.bat script in thirdparty\src.
-
-### openssl
-
- source: web site
- location: https://www.openssl.org/
- version: 1.1.0c
- directory: workspace\thirdparty\src\openssl-1.1.0c
- depends-on: zlib
-
-If you are using openssl-1.1.0 or later, they changed static builds to use Microsoft Static RTL for release builds. zlib by default uses a dynamic runtime, as does libevent. Edit the file Configurations/10-main.conf and replace the section contents for "VC-noCE-common" with what appears below to make openssl build with dynamic runtime instead:
-
- "VC-noCE-common" => {
- inherit_from => [ "VC-common" ],
- template => 1,
- cflags => add(picker(default => "-DUNICODE -D_UNICODE",
- debug => "/MDd /Od -DDEBUG -D_DEBUG",
- release => "/MD /O2"
- )),
- bin_cflags => add(picker(debug => "/MDd",
- release => "/MD",
- )),
- bin_lflags => add("/subsystem:console /opt:ref"),
- ex_libs => add(sub {
- my @ex_libs = ();
- push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
- push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
- return join(" ", @ex_libs);
- }),
- },
-
-To build, open the appropriate Visual Studio command prompt and then run
-the build-openssl.bat script in thirdparty\src.
-
-### libevent
-
- source: git
- location: https://github.com/nmathewson/Libevent.git
- use: commit 3821cca1a637f4da4099c9343e7326da00f6981c or later
- date: Fri Dec 23 16:19:35 2016 +0800 or later
- version: corresponds to 2.1.7rc + patches
- directory: workspace\thirdparty\src\libevent-2.1.7rc2
- depends-on: openssl, zlib
-
-To build, open the appropriate Visual Studio command prompt and then run
-the build-libevent.bat script in thirdparty\src.
-
-### msinttypes
-
- source: web site
- location: https://code.google.com/archive/p/msinttypes/downloads
- version: 26
- directory: workspace\thirdparty\dist\msinttypes
-
-> TIP: This is only necessary for Visual Studio 2010, which did not include an <inttypes.h> header.
-
-This third party package does not need to be built as it is a distribution of header files.
-
-### boost
-
- source: web site
- location: http://boost.teeks99.com/
- version: 1_62_0
- directory: workspace\thirdparty\dist\boost_1_62_0
-
-The pre-built binary versions of boost come in self-unpacking executables. Run each of the ones you are interested in and point them at the same thirdparty dist directory.
-
-## Building a Production thrift Compiler
-
-### Prerequisites
-
-* CMake-2.8.12.2 or later
-* Visual Studio 2010 or later
-* thrift source placed into workspace\thrift
-* winflexbison placed into workspace\thirdparty\dist
-
-### Instructions
-
-By following these instructions you will end up with a release mode thrift compiler that is suitable for distribution as it has no external dependencies.
-
-1. Open the appropriate Visual Studio Command Prompt.
-2. `cd workspace`
-3. `build-thrift-compiler.bat`
-
-The batch file uses CMake to generate an out-of-tree build directory in `workspace\build` and then builds the compiler. The resulting `thrift.exe` program is placed into `workspace\dist` in a path that depends on your compiler version and platform. For example, if you use a Visual Studio 2010 x64 Command Prompt, the compiler will be placed into `workspace\dist\thrift-compiler-dev\vc100\x64\Release\thrift.exe`
-
-#### Details
-
-This section is for those who are curious about the CMake options used in the build process.
-
-CMake takes the source tree as the first argument and uses the remaining arguments for configuration. The batch file `build-thrift-compiler` essentially performs the following commands:
-
- C:\> CD workspace\build
- C:\workspace\build> "C:\Program Files\CMake\bin\cmake.exe" ..\thrift
- -DBISON_EXECUTABLE=..\thirdparty\dist\winflexbison\win_bison.exe
- -DCMAKE_BUILD_TYPE=Release
- -DFLEX_EXECUTABLE=..\thirdparty\dist\winflexbison\win_flex.exe
- -DWITH_MT=ON
- -DWITH_SHARED_LIB=OFF
- -G"NMake Makefiles"
- C:\workspace\build> NMAKE /FMakefile thrift-compiler
-
-WITH_MT controls the dynamic or static runtime library selection. To build a production compiler, the thrift project recommends using the static runtime library to make the executable portable. The batch file sets this.
-
-You can build a Visual Studio project file by following the example but substituting a different generator for the "-G" option. Run `cmake.exe --help` for a list of generators. Typically, this is one of the following on Windows (omit "Win64" to build 32-bit instead):
-
-* "Visual Studio 10 2010 Win64"
-* "Visual Studio 11 2012 Win64"
-* "Visual Studio 12 2013 Win64"
-* "Visual Studio 14 2015 Win64"
-* "Visual Studio 15 2017 Win64"
-
-For example you can build using a Visual Studio solution file on the command line by doing:
-
- C:\> CD workspace\build
- C:\workspace\build> "C:\Program Files\CMake\bin\cmake.exe" ..\thrift
- -DBISON_EXECUTABLE=..\thirdparty\dist\winflexbison\win_bison.exe
- -DCMAKE_BUILD_TYPE=Release
- -DFLEX_EXECUTABLE=..\thirdparty\dist\winflexbison\win_flex.exe
- -DWITH_MT=ON
- -DWITH_SHARED_LIB=OFF
- -G"Visual Studio 14 2015 Win64"
- C:\workspace\build> MSBUILD "Apache Thrift.sln" /p:Configuration=Release /p:Platform=x64 /t:thrift-compiler
-
-You can also double-click on the solution file to bring it up in Visual Studio and build or debug interactively from there.
-
-## Building the thrift C++ Run-Time Library
-
-These instructions are similar to the compiler build however there are additional dependencies on third party libraries to build a feature-complete runtime. The resulting static link library for thrift uses a dynamic Microsoft runtime.
-
-1. Open the desired Visual Studio Command Prompt.
-2. `cd workspace`
-3. `build-thrift.bat`
-
-Thrift depends on boost, libevent, openssl, and zlib in order to build with all server and transport types. To use later versions of boost like 1.62 you will need a recent version of cmake (at least 3.7).
-
-The build-thrift script has options to build debug or release and to optionally disable any of the generation (cmake), build, or test phases. By default, the batch file will generate an out-of-tree build directory inside `workspace\build`, then perform a release build, then run the unit tests. The batch file accepts some option flags to control its behavior:
-
- :: Flags you can use to change this behavior:
- ::
- :: /DEBUG - if building, perform a debug build instead
- :: /NOGENERATE - skip cmake generation - useful if you
- :: have already generated a solution and just
- :: want to build
- :: /NOBUILD - skip cmake build - useful if you just
- :: want to generate a solution
- :: /NOTEST - skip ctest execution
-
-For example if you want to generate the cmake environment without building or running tests:
-
- C:\workspace> build-thrift.bat /NOBUILD /NOTEST
diff --git a/build/wincpp/build-thrift-compiler.bat b/build/wincpp/build-thrift-compiler.bat
deleted file mode 100644
index b6b42a8d7..000000000
--- a/build/wincpp/build-thrift-compiler.bat
+++ /dev/null
@@ -1,79 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Produces a production thrift compiler suitable for redistribution.
-:: The compiler is linked to runtime statically for maximum portability.
-:: Assumes the thirdparty files for "winflexbison" have been placed
-:: according to the README.md instructions.
-::
-:: Open a Visual Studio Command Prompt of your choosing and then
-:: run this script.
-
-@ECHO OFF
-SETLOCAL EnableDelayedExpansion
-
-IF NOT DEFINED PACKAGE_NAME SET PACKAGE_NAME=thrift
-IF NOT DEFINED PACKAGE_VERSION SET PACKAGE_VERSION=dev
-IF NOT DEFINED SOURCE_DIR SET SOURCEDIR=%~dp0%PACKAGE_NAME%
-IF NOT DEFINED WIN3P_ROOT SET WIN3P_ROOT=%~dp0thirdparty
-
-:: Set COMPILER to (vc100 - vc140) depending on the current environment
-CALL scripts\cl_setcompiler.bat || EXIT /B
-
-:: Set ARCH to either win32 or x64 depending on the current environment
-CALL scripts\cl_setarch.bat || EXIT /B
-
-:: Set GENERATOR for CMake depending on the current environment
-CALL scripts\cl_setgenerator.bat || EXIT /B
-
-IF NOT DEFINED BUILDTYPE (
- SET BUILDTYPE=Release
-)
-
- SET BUILDDIR=%~dp0build\%PACKAGE_NAME%-compiler\%PACKAGE_VERSION%\%COMPILER%\
- SET OUTDIR=%~dp0dist\%PACKAGE_NAME%-compiler-%PACKAGE_VERSION%\%COMPILER%\%ARCH%\%BUILDTYPE%\
- SET BOOST_LIBDIR=lib%ARCH:~-2,2%-msvc-%COMPILER:~-3,2%.0
- IF "%BUILDTYPE%" == "Debug" (SET ZLIB_STATIC_SUFFIX=d)
-
- ECHO/
- ECHO =========================================================================
- ECHO Configuration: %PACKAGE_NAME% %PACKAGE_VERSION% %COMPILER%:%ARCH%:%BUILDTYPE% "%GENERATOR%"
-IF DEFINED COMPILERONLY (
- ECHO COMPILER ONLY
-)
- ECHO Build Directory: %BUILDDIR%
- ECHO Install Directory: %OUTDIR%
- ECHO Source Directory: %SOURCEDIR%
- ECHO =========================================================================
- ECHO/
-
- MKDIR "%BUILDDIR%"
- CD "%BUILDDIR%" || EXIT /B
-
- CMAKE.EXE %~dp0thrift ^
- -G"%GENERATOR%" ^
- -DBISON_EXECUTABLE=%WIN3P_ROOT%\dist\winflexbison\win_bison.exe ^
- -DCMAKE_BUILD_TYPE=%BUILDTYPE% ^
- -DFLEX_EXECUTABLE=%WIN3P_ROOT%\dist\winflexbison\win_flex.exe ^
- -DWITH_MT=ON ^
- -DWITH_SHARED_LIB=OFF || EXIT /B
-
- CD %BUILDDIR%
-
- CMAKE.EXE --build . --config %BUILDTYPE% --target thrift-compiler || EXIT /B
- XCOPY /F /Y %BUILDDIR%\bin\%BUILDTYPE%\thrift.exe %OUTDIR%
-
-ENDLOCAL
-EXIT /B
diff --git a/build/wincpp/build-thrift.bat b/build/wincpp/build-thrift.bat
deleted file mode 100644
index b867acf24..000000000
--- a/build/wincpp/build-thrift.bat
+++ /dev/null
@@ -1,163 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Generates a Visual Studio solution for thrift and then builds it.
-:: Assumes third party libraries have been built or placed already.
-::
-:: Open a Visual Studio Command Prompt of your choosing and then
-:: run this script.
-::
-:: Normally the script will run cmake to generate a solution, then
-:: perform a build, then run tests on the complete thrift library
-:: in release mode.
-::
-:: Flags you can use to change this behavior:
-::
-:: /DEBUG - debug instead of release
-:: /IDE - launch Visual Studio with a path set
-:: up correctly to run tests instead of
-:: performing any other actions, i.e.
-:: implies setting the next three flags
-:: /NOGENERATE - skip cmake generation - useful if you
-:: have already generated a solution and just
-:: want to build
-:: /NOBUILD - skip cmake build - useful if you just
-:: want to generate a solution
-:: /NOTEST - skip ctest execution
-::
-
-@ECHO OFF
-SETLOCAL EnableDelayedExpansion
-
-:: Sets variables for third party versions used in build
-CALL scripts\tpversions.bat || EXIT /B
-
-IF NOT DEFINED PACKAGE_NAME SET PACKAGE_NAME=thrift
-IF NOT DEFINED PACKAGE_VERSION SET PACKAGE_VERSION=dev
-IF NOT DEFINED SOURCE_DIR SET SOURCEDIR=%~dp0%PACKAGE_NAME%
-IF NOT DEFINED WIN3P_ROOT SET WIN3P_ROOT=%~dp0thirdparty
-
-:: Set COMPILER to (vc100 - vc140) depending on the current environment
-CALL scripts\cl_setcompiler.bat || EXIT /B
-
-:: Set ARCH to either win32 or x64 depending on the current environment
-CALL scripts\cl_setarch.bat || EXIT /B
-
-:: Set GENERATOR for CMake depending on the current environment
-CALL scripts\cl_setgenerator.bat || EXIT /B
-
-:: Defaults
-
-IF NOT DEFINED BUILDTYPE SET BUILDTYPE=Release
-SET OPT_IDE=0
-SET OPT_BUILD=1
-SET OPT_GENERATE=1
-SET OPT_TEST=1
-
-:: Apply Flags
-
-IF /I "%1" == "/DEBUG" SET BUILDTYPE=Debug
-IF /I "%2" == "/DEBUG" SET BUILDTYPE=Debug
-IF /I "%3" == "/DEBUG" SET BUILDTYPE=Debug
-IF /I "%1" == "/IDE" SET OPT_IDE=1
-IF /I "%2" == "/IDE" SET OPT_IDE=1
-IF /I "%3" == "/IDE" SET OPT_IDE=1
-IF /I "%1" == "/NOBUILD" SET OPT_BUILD=0
-IF /I "%2" == "/NOBUILD" SET OPT_BUILD=0
-IF /I "%3" == "/NOBUILD" SET OPT_BUILD=0
-IF /I "%1" == "/NOGENERATE" SET OPT_GENERATE=0
-IF /I "%2" == "/NOGENERATE" SET OPT_GENERATE=0
-IF /I "%3" == "/NOGENERATE" SET OPT_GENERATE=0
-IF /I "%1" == "/NOTEST" SET OPT_TEST=0
-IF /I "%2" == "/NOTEST" SET OPT_TEST=0
-IF /I "%3" == "/NOTEST" SET OPT_TEST=0
-
-IF %OPT_IDE% == 1 (
- SET OPT_GENERATE=0
- SET OPT_BUILD=0
- SET OPT_TEST=0
-)
-
- SET BUILDDIR=%~dp0build\%PACKAGE_NAME%\%PACKAGE_VERSION%\%COMPILER%\%ARCH%\
- SET OUTDIR=%~dp0dist\%PACKAGE_NAME%-%PACKAGE_VERSION%\%COMPILER%\%ARCH%\%BUILDTYPE%\
- SET BOOST_LIBDIR=lib%ARCH:~-2,2%-msvc-%COMPILER:~-3,2%.0
- IF "%BUILDTYPE%" == "Debug" (SET ZLIB_STATIC_SUFFIX=d)
-
- ECHO/
- ECHO =========================================================================
- ECHO Configuration: %PACKAGE_NAME% %PACKAGE_VERSION% %COMPILER%:%ARCH%:%BUILDTYPE% "%GENERATOR%"
-IF DEFINED COMPILERONLY (
- ECHO COMPILER ONLY
-)
- ECHO Build Directory: %BUILDDIR%
- ECHO Install Directory: %OUTDIR%
- ECHO Source Directory: %SOURCEDIR%
- ECHO =========================================================================
- ECHO/
-
-IF %OPT_IDE% == 1 (
-
- CALL :SETRUNPATH || EXIT /B
- CALL DEVENV "!BUILDDIR!Apache Thrift.sln" || EXIT /B
- EXIT /B
-
-)
-
- MKDIR "%BUILDDIR%"
- CD "%BUILDDIR%" || EXIT /B
-
-IF %OPT_GENERATE% == 1 (
-
- CMAKE.EXE %~dp0thrift ^
- -G"%GENERATOR%" ^
- -DBISON_EXECUTABLE=%WIN3P_ROOT%\dist\winflexbison\win_bison.exe ^
- -DBOOST_ROOT=%WIN3P_ROOT%\dist\boost_%TP_BOOST_VERSION% ^
- -DBOOST_LIBRARYDIR=%WIN3P_ROOT%\dist\boost_%TP_BOOST_VERSION%\%BOOST_LIBDIR% ^
- -DCMAKE_INSTALL_PREFIX=%OUTDIR% ^
- -DCMAKE_BUILD_TYPE=%BUILDTYPE% ^
- -DFLEX_EXECUTABLE=%WIN3P_ROOT%\dist\winflexbison\win_flex.exe ^
- -DINTTYPES_ROOT=%WIN3P_ROOT%\dist\msinttypes ^
- -DLIBEVENT_ROOT=%WIN3P_ROOT%\dist\libevent-%TP_LIBEVENT_VERSION%\%COMPILER%\%ARCH%\%BUILDTYPE% ^
- -DOPENSSL_ROOT_DIR=%WIN3P_ROOT%\dist\openssl-%TP_OPENSSL_VERSION%\%COMPILER%\%ARCH%\%BUILDTYPE%\dynamic ^
- -DOPENSSL_USE_STATIC_LIBS=OFF ^
- -DZLIB_LIBRARY=%WIN3P_ROOT%\dist\zlib-%TP_ZLIB_VERSION%\%COMPILER%\%ARCH%\lib\zlib%ZLIB_LIB_SUFFIX%.lib ^
- -DZLIB_ROOT=%WIN3P_ROOT%\dist\zlib-%TP_ZLIB_VERSION%\%COMPILER%\%ARCH% ^
- -DWITH_SHARED_LIB=OFF ^
- -DWITH_STATIC_LIB=ON || EXIT /B
-
-)
-
-IF %OPT_BUILD% == 1 (
-
- CD %BUILDDIR%
- CMAKE.EXE --build . --config %BUILDTYPE% --target INSTALL || EXIT /B
-
-)
-
-IF %OPT_TEST% == 1 (
-
- CALL :SETRUNPATH || EXIT /B
- CMAKE.EXE --build . --config %BUILDTYPE% --target RUN_TESTS || EXIT /B
-
-)
-
-:SETRUNPATH
- SET PATH=!PATH!;%WIN3P_ROOT%\dist\boost_%TP_BOOST_VERSION%\%BOOST_LIBDIR%
- SET PATH=!PATH!;%WIN3P_ROOT%\dist\openssl-%TP_OPENSSL_VERSION%\%COMPILER%\%ARCH%\%BUILDTYPE%\dynamic\bin
- SET PATH=!PATH!;%WIN3P_ROOT%\dist\zlib-%TP_ZLIB_VERSION%\%COMPILER%\%ARCH%\bin
- EXIT /B
-
-ENDLOCAL
-EXIT /B
diff --git a/build/wincpp/scripts/cl_setarch.bat b/build/wincpp/scripts/cl_setarch.bat
deleted file mode 100644
index 9570a1e85..000000000
--- a/build/wincpp/scripts/cl_setarch.bat
+++ /dev/null
@@ -1,47 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Detect the architecture we're building for.
-:: Set the ARCH environment variable to one of:
-:: win32
-:: x64
-::
-:: Honors any existing ARCH environment variable
-:: setting instead of overwriting it, to allow it
-:: to be forced if needed.
-::
-:: Sets ERRORLEVEL to 0 if ARCH can be determined,
-:: to 1 if it cannot.
-::
-
-IF DEFINED ARCH (
- ECHO [warn ] using existing environment variable ARCH
- EXIT /B 0
-)
-
-CALL :CHECK x64
-IF %ERRORLEVEL% == 0 (SET ARCH=x64) ELSE (SET ARCH=win32)
-
-IF NOT DEFINED ARCH (
- ECHO [error] unable to determine the target architecture
- EXIT /B 1
-)
-
-ECHO [info ] detected target architecture %ARCH%
-EXIT /B 0
-
-:CHECK
-cl /? 2>&1 | findstr /C:" for %1%" > nul
-EXIT /B %ERRORLEVEL%
diff --git a/build/wincpp/scripts/cl_setcompiler.bat b/build/wincpp/scripts/cl_setcompiler.bat
deleted file mode 100644
index 8405d7616..000000000
--- a/build/wincpp/scripts/cl_setcompiler.bat
+++ /dev/null
@@ -1,58 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Detect the compiler edition we're building in.
-:: Set the COMPILER environment variable to one of:
-:: vc100 = Visual Studio 2010
-:: vc110 = Visual Studio 2012
-:: vc120 = Visual Studio 2013
-:: vc140 = Visual Studio 2015
-:: vc150 = Visual Studio 2017
-::
-:: Honors any existing COMPILER environment variable
-:: setting instead of overwriting it, to allow it
-:: to be forced if needed.
-::
-:: Sets ERRORLEVEL to 0 if COMPILER can be determined,
-:: to 1 if it cannot.
-::
-
-IF DEFINED COMPILER (
- ECHO [warn ] using existing environment variable COMPILER
- EXIT /B 0
-)
-
-CALL :CHECK 16
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED COMPILER SET COMPILER=vc100)
-CALL :CHECK 17
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED COMPILER SET COMPILER=vc110)
-CALL :CHECK 18
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED COMPILER SET COMPILER=vc120)
-CALL :CHECK 19.00
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED COMPILER SET COMPILER=vc140)
-CALL :CHECK 19.10
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED COMPILER SET COMPILER=vc150)
-
-IF NOT DEFINED COMPILER (
- ECHO [error] unable to determine the compiler edition
- EXIT /B 1
-)
-
-ECHO [info ] detected compiler edition %COMPILER%
-EXIT /B 0
-
-:CHECK
-cl /? 2>&1 | findstr /C:"Version %1%." > nul
-EXIT /B %ERRORLEVEL%
diff --git a/build/wincpp/scripts/cl_setgenerator.bat b/build/wincpp/scripts/cl_setgenerator.bat
deleted file mode 100644
index bae2742f7..000000000
--- a/build/wincpp/scripts/cl_setgenerator.bat
+++ /dev/null
@@ -1,69 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Detect the compiler edition we're building in and then
-:: set the GENERATOR environment variable to one of:
-::
-:: Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
-:: Optional [arch] can be "Win64" or "ARM".
-:: Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
-:: Optional [arch] can be "Win64" or "ARM".
-:: Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
-:: Optional [arch] can be "Win64" or "ARM".
-:: Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
-:: Optional [arch] can be "Win64" or "ARM".
-:: Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
-:: Optional [arch] can be "Win64" or "IA64".
-::
-:: Honors any existing GENERATOR environment variable
-:: setting instead of overwriting it, to allow it
-:: to be forced if needed.
-::
-:: Sets ERRORLEVEL to 0 if GENERATOR can be determined,
-:: to 1 if it cannot.
-::
-:: Requires cl_setarch.bat to have been executed or the ARCH environment
-:: variable to be set.
-::
-
-IF "%ARCH%" == "x64" (SET GENARCH= Win64)
-
-IF DEFINED GENERATOR (
- ECHO [warn ] using existing environment variable GENERATOR
- EXIT /B 0
-)
-
-CALL :CHECK 16
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED GENERATOR SET GENERATOR=Visual Studio 10 2010%GENARCH%)
-CALL :CHECK 17
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED GENERATOR SET GENERATOR=Visual Studio 11 2012%GENARCH%)
-CALL :CHECK 18
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED GENERATOR SET GENERATOR=Visual Studio 12 2013%GENARCH%)
-CALL :CHECK 19.00
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED GENERATOR SET GENERATOR=Visual Studio 14 2015%GENARCH%)
-CALL :CHECK 19.10
-IF %ERRORLEVEL% == 0 (IF NOT DEFINED GENERATOR SET GENERATOR=Visual Studio 15 2017%GENARCH%)
-
-IF NOT DEFINED GENERATOR (
- ECHO [error] unable to determine the CMake generator to use
- EXIT /B 1
-)
-
-ECHO [info ] using CMake generator %GENERATOR%
-EXIT /B 0
-
-:CHECK
-cl /? 2>&1 | findstr /C:"Version %1%." > nul
-EXIT /B %ERRORLEVEL%
diff --git a/build/wincpp/scripts/tpversions.bat b/build/wincpp/scripts/tpversions.bat
deleted file mode 100644
index d80c86878..000000000
--- a/build/wincpp/scripts/tpversions.bat
+++ /dev/null
@@ -1,24 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Set the versions of third party libraries to use.
-::
-
-IF NOT DEFINED TP_BOOST_VERSION SET TP_BOOST_VERSION=1_62_0
-IF NOT DEFINED TP_LIBEVENT_VERSION SET TP_LIBEVENT_VERSION=2.1.7rc2
-IF NOT DEFINED TP_OPENSSL_VERSION SET TP_OPENSSL_VERSION=1.1.0c
-IF NOT DEFINED TP_ZLIB_VERSION SET TP_ZLIB_VERSION=1.2.9
-
-EXIT /B 0
diff --git a/build/wincpp/thirdparty/src/build-libevent.bat b/build/wincpp/thirdparty/src/build-libevent.bat
deleted file mode 100644
index 4af505c61..000000000
--- a/build/wincpp/thirdparty/src/build-libevent.bat
+++ /dev/null
@@ -1,86 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Build script for libevent on windows
-:: Use libevent master from github which has cmake integration
-:: Uses the environment set up by a Visual Studio Command Prompt shortcut
-:: to target a specific architecture and compiler
-::
-:: Creates a static link library.
-:: Links against OpenSSL and zlib statically.
-::
-
-@ECHO OFF
-SETLOCAL EnableDelayedExpansion
-
-:: Sets variables for third party versions used in build
-CALL ..\..\scripts\tpversions.bat || EXIT /B
-
-:: use "build-libevent.bat /yes" to skip the question part
-IF /I "%1" == "/YES" SET NOASK=1
-
-:: Set COMPILER to (vc100 - vc140) depending on the current environment
-CALL ..\..\scripts\cl_setcompiler.bat || EXIT /B
-
-:: Set ARCH to either win32 or x64 depending on the current environment
-CALL ..\..\scripts\cl_setarch.bat || EXIT /B
-
-IF NOT DEFINED GENERATOR SET GENERATOR=NMake Makefiles
-IF NOT DEFINED PACKAGE_NAME SET PACKAGE_NAME=libevent
-IF NOT DEFINED PACKAGE_VERSION SET PACKAGE_VERSION=%TP_LIBEVENT_VERSION%
-IF NOT DEFINED SOURCEDIR SET SOURCEDIR=%~dp0%PACKAGE_NAME%-%PACKAGE_VERSION%
-IF NOT DEFINED WIN3P_ROOT SET WIN3P_ROOT=%~dp0..
-
-FOR %%X IN (
- Debug
- Release
-) DO (
- SET BUILDTYPE=%%X
- SET BUILDDIR=%WIN3P_ROOT%\build\%PACKAGE_NAME%\%PACKAGE_VERSION%\%COMPILER%\%ARCH%\!BUILDTYPE!
- SET OUTDIR=%WIN3P_ROOT%\dist\%PACKAGE_NAME%-%PACKAGE_VERSION%\%COMPILER%\%ARCH%\!BUILDTYPE!
-
- IF "!BUILDTYPE!" == "Debug" (SET ZLIB_LIB_SUFFIX=d)
-
- SET CMAKE_DEFS=^
- -DEVENT__DISABLE_SAMPLES=ON ^
- -DEVENT__DISABLE_TESTS=ON ^
- -DOPENSSL_USE_STATIC_LIBS=OFF ^
- -DOPENSSL_ROOT_DIR=%WIN3P_ROOT%\dist\openssl-%TP_OPENSSL_VERSION%\%COMPILER%\%ARCH%\!BUILDTYPE!\dynamic ^
- -DZLIB_LIBRARY=%WIN3P_ROOT%\dist\zlib-%TP_ZLIB_VERSION%\%COMPILER%\%ARCH%\lib\zlib!ZLIB_LIB_SUFFIX!.lib ^
- -DZLIB_ROOT=%WIN3P_ROOT%\dist\zlib-%TP_ZLIB_VERSION%\%COMPILER%\%ARCH%
-
- ECHO/
- ECHO =========================================================================
- ECHO Building: %PACKAGE_NAME% v%PACKAGE_VERSION% %COMPILER%:%ARCH%:!BUILDTYPE! "%GENERATOR%"
- ECHO CMake Definitions: !CMAKE_DEFS!
- ECHO Build Directory: !BUILDDIR!
- ECHO Install Directory: !OUTDIR!
- ECHO Source Directory: %SOURCEDIR%
- ECHO =========================================================================
- ECHO/
-
- IF NOT DEFINED NOASK (
- CHOICE /M "Do you want to build this configuration? " /c YN
- IF !ERRORLEVEL! NEQ 1 (EXIT /B !ERRORLEVEL!)
- )
-
- MKDIR "!BUILDDIR!"
- CD "!BUILDDIR!" || EXIT /B
-
- CMAKE.EXE -G"%GENERATOR%" -DCMAKE_INSTALL_PREFIX=!OUTDIR! -DCMAKE_BUILD_TYPE=!BUILDTYPE! !CMAKE_DEFS! "%SOURCEDIR%" || EXIT /B
- NMAKE /fMakefile install || EXIT /B
-)
-
-ENDLOCAL
diff --git a/build/wincpp/thirdparty/src/build-openssl.bat b/build/wincpp/thirdparty/src/build-openssl.bat
deleted file mode 100644
index cf270f05b..000000000
--- a/build/wincpp/thirdparty/src/build-openssl.bat
+++ /dev/null
@@ -1,106 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Build script for openssl on windows
-:: openssl uses an in-tree build so you have to clean between each one
-::
-:: Uses the environment set up by a Visual Studio Command Prompt shortcut
-:: to target a specific architecture and compiler
-::
-:: If you use Lavasoft Ad-Aware, disable it for this build. It blocks the creation
-:: of any file named "clienthellotest.exe" for whatever reason, which breaks the build.
-::
-
-@ECHO OFF
-SETLOCAL EnableDelayedExpansion
-
-:: Sets variables for third party versions used in build
-CALL ..\..\scripts\tpversions.bat || EXIT /B
-
-:: use "build-openssl.bat /yes" to skip the question part
-IF /I "%1" == "/YES" SET NOASK=1
-
-IF NOT DEFINED PACKAGE_NAME SET PACKAGE_NAME=openssl
-IF NOT DEFINED PACKAGE_VERSION SET PACKAGE_VERSION=%TP_OPENSSL_VERSION%
-IF NOT DEFINED SOURCEDIR SET SOURCEDIR=%~dp0%PACKAGE_NAME%-%PACKAGE_VERSION%
-IF NOT DEFINED WIN3P_ROOT SET WIN3P_ROOT=%~dp0..
-
-:: Set COMPILER to (vc100 - vc140) depending on the current environment
-CALL ..\..\scripts\cl_setcompiler.bat || EXIT /B
-
-:: Set ARCH to either win32 or x64 depending on the current environment
-CALL ..\..\scripts\cl_setarch.bat || EXIT /B
-
-IF "%ARCH%" == "x64" (
- SET TODO=debug-VC-WIN64A VC-WIN64A
-) ELSE (
- SET TODO=debug-VC-WIN32 VC-WIN32
-)
-
-FOR %%X IN ( !TODO! ) DO (
- SET BUILDTYPE=%%X
- FOR %%Y IN (
- nt
- ntdll
- ) DO (
- SET LIBTYPE=%%Y
-
- IF "!BUILDTYPE:~0,6!" == "debug-" (
- SET OUTBUILDTYPE=debug
- SET ZLIBLIBSUFFIX=d
- ) ELSE (
- SET OUTBUILDTYPE=release
- SET ZLIBLIBSUFFIX=
- )
-
- IF "!LIBTYPE!" == "ntdll" (
- SET BUILD_OPTIONS=shared
- SET OUTLIBTYPE=dynamic
- SET ZLIBLIB=zlib!ZLIBLIBSUFFIX!
- SET ZLIBOPT=zlib-dynamic
- ) ELSE (
- SET BUILD_OPTIONS=no-shared
- SET OUTLIBTYPE=static
- SET ZLIBLIB=zlibstatic!ZLIBLIBSUFFIX!.lib
- SET ZLIBOPT=zlib
- )
-
- SET LIB=%~dp0..\dist\zlib-%TP_ZLIB_VERSION%\!COMPILER!\!ARCH!\lib;!LIB!
- SET BUILD_OPTIONS=!BUILD_OPTIONS! no-asm no-unit-test !ZLIBOPT! --openssldir=ssl --with-zlib-include=%~dp0..\dist\zlib-%TP_ZLIB_VERSION%\!COMPILER!\!ARCH!\include --with-zlib-lib=!ZLIBLIB!
- SET OUTDIR=%WIN3P_ROOT%\dist\%PACKAGE_NAME%-%PACKAGE_VERSION%\%COMPILER%\%ARCH%\!OUTBUILDTYPE!\!OUTLIBTYPE!
-
- ECHO/
- ECHO =========================================================================
- ECHO Building: %PACKAGE_NAME% %PACKAGE_VERSION% %COMPILER%:%ARCH%:!OUTBUILDTYPE!:!OUTLIBTYPE! [!BUILDTYPE!]
- ECHO Configure Options: !BUILD_OPTIONS!
- ECHO Install Directory: !OUTDIR!
- ECHO Source Directory: %SOURCEDIR%
- ECHO =========================================================================
- ECHO/
-
- IF NOT DEFINED NOASK (
- CHOICE /M "Do you want to build this configuration? " /c YN
- IF !ERRORLEVEL! NEQ 1 (EXIT /B !ERRORLEVEL!)
- )
-
- CD %SOURCEDIR% || EXIT /B
- perl Configure !BUILDTYPE! --prefix="!OUTDIR!" !BUILD_OPTIONS! || EXIT /B
- NMAKE /FMakefile install_sw || EXIT /B
- NMAKE /FMakefile clean || EXIT /B
- )
-)
-
-ENDLOCAL
-EXIT /B
diff --git a/build/wincpp/thirdparty/src/build-zlib.bat b/build/wincpp/thirdparty/src/build-zlib.bat
deleted file mode 100644
index 2427230d0..000000000
--- a/build/wincpp/thirdparty/src/build-zlib.bat
+++ /dev/null
@@ -1,75 +0,0 @@
-::
-:: Licensed under the Apache License, Version 2.0 (the "License");
-:: you may not use this file except in compliance with the License.
-:: You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing, software
-:: distributed under the License is distributed on an "AS IS" BASIS,
-:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-:: See the License for the specific language governing permissions and
-:: limitations under the License.
-::
-
-::
-:: Build script for zlib on windows.
-:: Uses the environment set up by a Visual Studio Command Prompt shortcut
-:: to target a specific architecture and compiler.
-::
-
-@ECHO OFF
-SETLOCAL EnableDelayedExpansion
-
-:: Sets variables for third party versions used in build
-CALL ..\..\scripts\tpversions.bat || EXIT /B
-
-:: use "build-zlib.bat /yes" to skip the question part
-IF /I "%1" == "/YES" SET NOASK=1
-
-IF NOT DEFINED GENERATOR SET GENERATOR=NMake Makefiles
-IF NOT DEFINED PACKAGE_NAME SET PACKAGE_NAME=zlib
-IF NOT DEFINED PACKAGE_VERSION SET PACKAGE_VERSION=%TP_ZLIB_VERSION%
-IF NOT DEFINED SOURCE_DIR SET SOURCEDIR=%~dp0%PACKAGE_NAME%-%PACKAGE_VERSION%
-IF NOT DEFINED WIN3P_ROOT SET WIN3P_ROOT=%~dp0..
-
-:: Set COMPILER to (vc100 - vc140) depending on the current environment
-CALL ..\..\scripts\cl_setcompiler.bat || EXIT /B
-
-:: Set ARCH to either win32 or x64 depending on the current environment
-CALL ..\..\scripts\cl_setarch.bat || EXIT /B
-
-FOR %%X IN (
- Debug
- Release
-) DO (
- SET BUILDTYPE=%%X
- SET BUILDDIR=%WIN3P_ROOT%\build\%PACKAGE_NAME%\%PACKAGE_VERSION%\%COMPILER%\%ARCH%\!BUILDTYPE!
- SET OUTDIR=%WIN3P_ROOT%\dist\%PACKAGE_NAME%-%PACKAGE_VERSION%\%COMPILER%\%ARCH%
-
- ECHO/
- ECHO =========================================================================
- ECHO Building: %PACKAGE_NAME% v%PACKAGE_VERSION% %COMPILER%:%ARCH%:!BUILDTYPE! "%GENERATOR%"
- ECHO Build Directory: !BUILDDIR!
- ECHO Install Directory: !OUTDIR!
- ECHO Source Directory: %SOURCEDIR%
- ECHO =========================================================================
- ECHO/
-
- IF NOT DEFINED NOASK (
- CHOICE /M "Do you want to build this configuration? " /c YN
- IF !ERRORLEVEL! NEQ 1 (EXIT /B !ERRORLEVEL!)
- )
-
- MKDIR "!BUILDDIR!"
- CD "!BUILDDIR!" || EXIT /B
-
- CMAKE.EXE -G"%GENERATOR%" -DCMAKE_INSTALL_PREFIX=!OUTDIR! -DCMAKE_BUILD_TYPE=!BUILDTYPE! "%SOURCEDIR%" || EXIT /B
- NMAKE /fMakefile install || EXIT /B
-
- IF "!BUILDTYPE!" == "Debug" (
- COPY "!BUILDDIR!\zlibd.pdb" "!OUTDIR!\bin\" || EXIT /B
- )
-)
-
-ENDLOCAL
diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
index 0df790ee2..96efe65ab 100644
--- a/compiler/cpp/CMakeLists.txt
+++ b/compiler/cpp/CMakeLists.txt
@@ -16,18 +16,11 @@
# specific language governing permissions and limitations
# under the License.
#
-cmake_minimum_required(VERSION 2.8.12)
+
+cmake_minimum_required(VERSION 3.3)
+project("thrift-compiler" VERSION ${PACKAGE_VERSION})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/thrift/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/thrift/version.h)
-if(MSVC)
- # The winflexbison generator outputs some macros that conflict with the Visual Studio 2010 copy of stdint.h
- # This might be fixed in later versions of Visual Studio, but an easy solution is to include stdint.h first
- if(HAVE_STDINT_H)
- add_definitions(-D__STDC_FORMAT_MACROS)
- add_definitions(-D__STDC_LIMIT_MACROS)
- add_definitions(/FI"stdint.h")
- endif(HAVE_STDINT_H)
-endif()
find_package(FLEX REQUIRED)
find_package(BISON REQUIRED)
@@ -78,36 +71,37 @@ macro(THRIFT_ADD_COMPILER name description initial)
endmacro()
# The following compiler can be enabled or disabled
+THRIFT_ADD_COMPILER(as3 "Enable compiler for ActionScript 3" ON)
THRIFT_ADD_COMPILER(c_glib "Enable compiler for C with Glib" ON)
+THRIFT_ADD_COMPILER(cl "Enable compiler for Common LISP" ON)
+THRIFT_ADD_COMPILER(cocoa "Enable compiler for Cocoa Objective-C" ON)
THRIFT_ADD_COMPILER(cpp "Enable compiler for C++" ON)
-THRIFT_ADD_COMPILER(java "Enable compiler for Java" ON)
-THRIFT_ADD_COMPILER(as3 "Enable compiler for ActionScript 3" ON)
-THRIFT_ADD_COMPILER(dart "Enable compiler for Dart" ON)
-THRIFT_ADD_COMPILER(haxe "Enable compiler for Haxe" ON)
THRIFT_ADD_COMPILER(csharp "Enable compiler for C#" ON)
-THRIFT_ADD_COMPILER(netcore "Enable compiler for .NET Core" ON)
-THRIFT_ADD_COMPILER(py "Enable compiler for Python 2.0" ON)
-THRIFT_ADD_COMPILER(rb "Enable compiler for Ruby" ON)
-THRIFT_ADD_COMPILER(perl "Enable compiler for Perl" ON)
-THRIFT_ADD_COMPILER(php "Enable compiler for PHP" ON)
+THRIFT_ADD_COMPILER(d "Enable compiler for D" ON)
+THRIFT_ADD_COMPILER(dart "Enable compiler for Dart" ON)
+THRIFT_ADD_COMPILER(delphi "Enable compiler for Delphi" ON)
THRIFT_ADD_COMPILER(erl "Enable compiler for Erlang" ON)
-THRIFT_ADD_COMPILER(cocoa "Enable compiler for Cocoa Objective-C" ON)
-THRIFT_ADD_COMPILER(swift "Enable compiler for Cocoa Swift" ON)
-THRIFT_ADD_COMPILER(st "Enable compiler for Smalltalk" ON)
-THRIFT_ADD_COMPILER(ocaml "Enable compiler for OCaml" ON)
+THRIFT_ADD_COMPILER(go "Enable compiler for Go" ON)
+THRIFT_ADD_COMPILER(gv "Enable compiler for GraphViz" ON)
+THRIFT_ADD_COMPILER(haxe "Enable compiler for Haxe" ON)
THRIFT_ADD_COMPILER(hs "Enable compiler for Haskell" ON)
-THRIFT_ADD_COMPILER(xsd "Enable compiler for XSD" ON)
THRIFT_ADD_COMPILER(html "Enable compiler for HTML Documentation" ON)
+THRIFT_ADD_COMPILER(java "Enable compiler for Java" ON)
+THRIFT_ADD_COMPILER(javame "Enable compiler for Java ME" ON)
THRIFT_ADD_COMPILER(js "Enable compiler for JavaScript" ON)
THRIFT_ADD_COMPILER(json "Enable compiler for JSON" ON)
-THRIFT_ADD_COMPILER(javame "Enable compiler for Java ME" ON)
-THRIFT_ADD_COMPILER(delphi "Enable compiler for Delphi" ON)
-THRIFT_ADD_COMPILER(go "Enable compiler for Go" ON)
-THRIFT_ADD_COMPILER(d "Enable compiler for D" ON)
THRIFT_ADD_COMPILER(lua "Enable compiler for Lua" ON)
-THRIFT_ADD_COMPILER(gv "Enable compiler for GraphViz" ON)
+THRIFT_ADD_COMPILER(netcore "Enable compiler for .NET Core" ON)
+THRIFT_ADD_COMPILER(ocaml "Enable compiler for OCaml" ON)
+THRIFT_ADD_COMPILER(perl "Enable compiler for Perl" ON)
+THRIFT_ADD_COMPILER(php "Enable compiler for PHP" ON)
+THRIFT_ADD_COMPILER(py "Enable compiler for Python 2.0" ON)
+THRIFT_ADD_COMPILER(rb "Enable compiler for Ruby" ON)
THRIFT_ADD_COMPILER(rs "Enable compiler for Rust" ON)
+THRIFT_ADD_COMPILER(st "Enable compiler for Smalltalk" ON)
+THRIFT_ADD_COMPILER(swift "Enable compiler for Cocoa Swift" ON)
THRIFT_ADD_COMPILER(xml "Enable compiler for XML" ON)
+THRIFT_ADD_COMPILER(xsd "Enable compiler for XSD" ON)
# Thrift is looking for include files in the src directory
# we also add the current binary directory for generated files
diff --git a/compiler/cpp/test/CMakeLists.txt b/compiler/cpp/test/CMakeLists.txt
index 572b55890..373cb78f0 100644
--- a/compiler/cpp/test/CMakeLists.txt
+++ b/compiler/cpp/test/CMakeLists.txt
@@ -31,18 +31,10 @@ if(${WITH_PLUGIN})
plugin/conversion_test.cc
)
add_executable(plugintest ${plugintest_SOURCES})
- if(WITH_SHARED_LIB AND NOT MSVC)
- target_link_libraries(plugintest
- thriftc
- ${Boost_LIBRARIES}
- )
- else()
- target_link_libraries(plugintest
- thriftc_static
- thrift_static
- ${Boost_LIBRARIES}
- )
- endif()
+ target_link_libraries(plugintest
+ thriftc
+ ${Boost_LIBRARIES}
+ )
add_test(NAME PluginUnitTest COMMAND plugintest)
set(thrift-gen-mycpp_SOURCES
@@ -50,11 +42,7 @@ if(${WITH_PLUGIN})
plugin/cpp_plugin.cc
)
add_executable(thrift-gen-mycpp ${thrift-gen-mycpp_SOURCES})
- if(WITH_SHARED_LIB AND NOT MSVC)
- target_link_libraries(thrift-gen-mycpp thriftc)
- else()
- target_link_libraries(thrift-gen-mycpp thriftc_static thrift_static)
- endif()
+ target_link_libraries(thrift-gen-mycpp thriftc)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILDTYPE "Debug")
@@ -91,5 +79,9 @@ foreach(LANG ${thrift_compiler_LANGS})
endforeach()
-find_package(PythonInterp REQUIRED)
-add_test(NAME StalenessCheckTest COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/compiler/staleness_check.py ${THRIFT_COMPILER})
+find_package(PythonInterp QUIET)
+if(PYTHONINTERP_FOUND)
+ add_test(NAME StalenessCheckTest COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/compiler/staleness_check.py ${THRIFT_COMPILER})
+else()
+ message(WARNING "Skipping StalenessCheckTest as there is no python interpreter available.")
+endif() \ No newline at end of file
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index e12c08ce2..8e5ebcf61 100755
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -158,8 +158,8 @@ if(WITH_LIBEVENT)
include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS})
ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES})
+ LINK_AGAINST_THRIFT_LIBRARY(thriftnb thrift)
TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES})
- TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY(thriftnb thrift)
endif()
if(WITH_ZLIB)
diff --git a/lib/cpp/README.md b/lib/cpp/README.md
index 5806f7b4a..bc47d2d6d 100755
--- a/lib/cpp/README.md
+++ b/lib/cpp/README.md
@@ -240,8 +240,13 @@ run the tests. This means the header thrift/stdcxx.h has been removed and
anything that relied on it has been changed to directly use C++11 concepts.
The classes BoostThreadFactory, PosixThreadFactory, StdThreadFactory, and
-PlatformThreadFactory will all be removed, and we will use a ThreadFactory
-based on C++11.
+PlatformThreadFactory have been removed, and we will use a ThreadFactory
+based on C++11 (essentially StdThreadFactory was renamed ThreadFactory).
+
+The CMake build options WITH_SHARED_LIBS and WITH_STATIC_LIBS are deprecated.
+The project no longer performs a side-by-side static and shared build; you
+tell CMake through BUILD_SHARED_LIBS whether to make shared or static
+libraries now. This is CMake standard behavior.
## 0.11.0
diff --git a/lib/cpp/src/thrift/TOutput.cpp b/lib/cpp/src/thrift/TOutput.cpp
index ae3a9e282..af36137b4 100644
--- a/lib/cpp/src/thrift/TOutput.cpp
+++ b/lib/cpp/src/thrift/TOutput.cpp
@@ -29,6 +29,8 @@ namespace thrift {
TOutput GlobalOutput;
+TOutput::TOutput() : f_(&errorTimeWrapper) {}
+
void TOutput::printf(const char* message, ...) {
#ifndef THRIFT_SQUELCH_CONSOLE_OUTPUT
// Try to reduce heap usage, even if printf is called rarely.
diff --git a/lib/cpp/src/thrift/TOutput.h b/lib/cpp/src/thrift/TOutput.h
index 1375f737d..6135cfa15 100644
--- a/lib/cpp/src/thrift/TOutput.h
+++ b/lib/cpp/src/thrift/TOutput.h
@@ -25,7 +25,7 @@ namespace thrift {
class TOutput {
public:
- TOutput() : f_(&errorTimeWrapper) {}
+ TOutput();
inline void setOutputFunction(void (*function)(const char*)) { f_ = function; }
diff --git a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
index 4576fa166..db407f2c6 100644
--- a/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/thrift/protocol/TJSONProtocol.cpp
@@ -898,7 +898,7 @@ uint32_t TJSONProtocol::readJSONDouble(double& num) {
}
try {
num = fromString<double>(str);
- } catch (std::runtime_error& e) {
+ } catch (const std::runtime_error&) {
throw TProtocolException(TProtocolException::INVALID_DATA,
"Expected numeric value; got \"" + str + "\"");
}
@@ -911,7 +911,7 @@ uint32_t TJSONProtocol::readJSONDouble(double& num) {
result += readJSONNumericChars(str);
try {
num = fromString<double>(str);
- } catch (std::runtime_error& e) {
+ } catch (const std::runtime_error&) {
throw TProtocolException(TProtocolException::INVALID_DATA,
"Expected numeric value; got \"" + str + "\"");
}