Support parallel 64- and 32-bit boost binaries (RIPD-1317):

* CMake and scons
* Update Visual Studio build docs
* Cache Appveyor PIP downloads for scons builds
* Rename the CMakeFuncs `find_` functions to `use_`
This commit is contained in:
Edward Hennis
2016-11-04 19:55:13 -04:00
committed by Nik Bougalis
parent b6ce0aa75a
commit fd901f8081
8 changed files with 96 additions and 52 deletions

View File

@@ -235,8 +235,8 @@ macro(check_gcc4_abi)
if (is_gcc AND NOT gcc4_abi)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5)
execute_process(COMMAND lsb_release -si OUTPUT_VARIABLE lsb)
string(STRIP ${lsb} lsb)
if (${lsb} STREQUAL "Ubuntu")
string(STRIP "${lsb}" lsb)
if ("${lsb}" STREQUAL "Ubuntu")
execute_process(COMMAND lsb_release -sr OUTPUT_VARIABLE lsb)
string(STRIP ${lsb} lsb)
if (${lsb} VERSION_LESS 15.1)
@@ -268,8 +268,21 @@ endmacro()
############################################################
# Params: Boost components to search for.
macro(find_boost)
if (NOT WIN32)
macro(use_boost)
if(WIN32 OR CYGWIN)
# Workaround for MSVC having two boost versions - x86 and x64 on same PC in stage folders
if ((NOT DEFINED BOOST_ROOT) AND (DEFINED ENV{BOOST_ROOT}))
set(BOOST_ROOT $ENV{BOOST_ROOT})
endif()
if(DEFINED BOOST_ROOT)
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND IS_DIRECTORY ${BOOST_ROOT}/stage64/lib)
set(Boost_LIBRARY_DIR ${BOOST_ROOT}/stage64/lib)
else()
set(Boost_LIBRARY_DIR ${BOOST_ROOT}/stage/lib)
endif()
endif()
endif()
if (is_clang AND DEFINED ENV{CLANG_BOOST_ROOT})
set(BOOST_ROOT $ENV{CLANG_BOOST_ROOT})
endif()
@@ -280,22 +293,19 @@ macro(find_boost)
find_package(Boost COMPONENTS
${ARGN})
if (Boost_FOUND)
if (Boost_FOUND OR
((CYGWIN OR WIN32) AND Boost_INCLUDE_DIRS AND Boost_LIBRARY_DIRS))
if(NOT Boost_FOUND)
message(WARNING "Boost directory found, but not all components. May not be able to build.")
endif()
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
else()
message(FATAL_ERROR "Boost not found")
endif()
else(DEFINED ENV{BOOST_ROOT})
include_directories(SYSTEM $ENV{BOOST_ROOT})
if(IS_DIRECTORY $ENV{BOOST_ROOT}/stage64/lib)
link_directories($ENV{BOOST_ROOT}/stage64/lib)
else()
link_directories($ENV{BOOST_ROOT}/stage/lib)
endif()
endif()
endmacro()
macro(find_pthread)
macro(use_pthread)
if (NOT WIN32)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
@@ -303,7 +313,7 @@ macro(find_pthread)
endif()
endmacro()
macro(find_openssl openssl_min)
macro(use_openssl openssl_min)
if (APPLE AND NOT DEFINED ENV{OPENSSL_ROOT_DIR})
find_program(HOMEBREW brew)
if (NOT HOMEBREW STREQUAL "HOMEBREW-NOTFOUND")
@@ -342,7 +352,7 @@ macro(find_openssl openssl_min)
endif()
endmacro()
macro(find_protobuf)
macro(use_protobuf)
if (WIN32)
if (DEFINED ENV{PROTOBUF_ROOT})
include_directories($ENV{PROTOBUF_ROOT}/src)
@@ -622,7 +632,7 @@ macro(set_startup_project cur_project)
endmacro()
macro(link_common_libraries cur_project)
if (NOT WIN32)
if (NOT MSVC)
target_link_libraries(${cur_project} ${Boost_LIBRARIES})
target_link_libraries(${cur_project} dl)
target_link_libraries(${cur_project} Threads::Threads)
@@ -634,7 +644,7 @@ macro(link_common_libraries cur_project)
else()
target_link_libraries(${cur_project} rt)
endif()
else(NOT WIN32)
else(NOT MSVC)
target_link_libraries(${cur_project}
$<$<OR:$<CONFIG:Debug>,$<CONFIG:DebugClassic>>:VC/static/ssleay32MTd>
$<$<OR:$<CONFIG:Debug>,$<CONFIG:DebugClassic>>:VC/static/libeay32MTd>)
@@ -644,5 +654,5 @@ macro(link_common_libraries cur_project)
target_link_libraries(${cur_project}
legacy_stdio_definitions.lib Shlwapi kernel32 user32 gdi32 winspool comdlg32
advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32)
endif (NOT WIN32)
endif (NOT MSVC)
endmacro()

View File

@@ -17,7 +17,7 @@ software components:
* [Google Protocol Buffers Compiler](README.md#install-google-protocol-buffers-compiler)
* (Optional) [Python and Scons](README.md#optional-install-python-and-scons)
* [OpenSSL Library](README.md#install-openssl)
* [Boost 1.59 library](README.md#build-boost)
* [Boost library](README.md#build-boost)
* [Node.js](README.md#install-nodejs)
## Install Software
@@ -84,8 +84,8 @@ for Visual Studio 2015 support.
[Download OpenSSL.](http://slproweb.com/products/Win32OpenSSL.html)
There will be four variants available:
1. 64-bit. Use this if you are running 64-bit windows. As of this writing, the link is called: "Win64 OpenSSL v1.0.2d".
2. 64-bit light - Don't use this. It is missing files needed to build rippled. As of this writing, the link is called: "Win64 OpenSSL v1.0.2d Light"
1. 64-bit. Use this if you are running 64-bit windows. As of this writing, the link is called: "Win64 OpenSSL v1.0.2j".
2. 64-bit light - Don't use this. It is missing files needed to build rippled. As of this writing, the link is called: "Win64 OpenSSL v1.0.2j Light"
Run the installer, and choose an appropriate location for your OpenSSL
installation. In this guide we use **C:\lib\OpenSSL-Win64** as the
@@ -108,8 +108,13 @@ unpacking it, open a **Developer Command Prompt** for
Visual Studio, change to the directory containing boost, then
bootstrap the build tools:
(As of this writing, the most recent version of boost is 1.62.0, which
will unpack into a directory named `boost_1_62_0`. For higher versions
of boost, adjust the directories provided in these examples as
appropriate.)
```powershell
cd C:\lib\boost_1_59_0
cd C:\lib\boost_1_62_0
bootstrap
```
@@ -119,7 +124,7 @@ affected by changes in outside files. Therefore, it is necessary to build the
required boost static libraries using this command:
```powershell
bjam --toolset=msvc-14.0 --build-type=complete variant=debug,release link=static runtime-link=static address-model=64
bjam --toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared,static stage --stagedir=stage64
```
Building the boost libraries may take considerable time. When the build process
@@ -161,7 +166,7 @@ git checkout master
### Configure Library Paths
Open the solution file located at **Builds/Visual Studio 2015/ripple.sln**
and select the "View->Other Windows->Property Manager" to bring up the Property Manager.
and select the "View->Property Manager" to bring up the Property Manager.
Expand the *debug | x64* section and
double click the *Microsoft.Cpp.x64.user* property sheet to bring up the
*Property Pages* dialog. These are global properties applied to all

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 66 KiB