Skip to content

Commit 824f09a

Browse files
ahladikaothms
authored andcommitted
More changes to Visual Studio build process
Prevented incorrect linking to default libraries in Boost Boost version updated to 1.74
1 parent 6a8d813 commit 824f09a

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

cmake/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ IF(WIN32 AND ("$ENV{CONDA_BUILD}" STREQUAL ""))
143143
SET(Boost_USE_STATIC_LIBS ON)
144144
SET(Boost_USE_STATIC_RUNTIME ON)
145145
SET(Boost_USE_MULTITHREADED ON)
146+
# Disable Boost's autolinking as the libraries to be linked to are supplied
147+
# already by CMake, and wrong libraries would be asked for when code is
148+
# compiled with a toolset different from default.
149+
if(MSVC)
150+
ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB)
151+
# Necessary for boost version >= 1.67
152+
SET(BCRYPT_LIBRARIES "bcrypt.lib")
153+
ENDIF()
146154
ELSE()
147155
# Disable Boost's autolinking as the libraries to be linked to are supplied
148156
# already by CMake, and it's going to conflict if there are multiple, as is

win/build-deps.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ cd "%DEPS_DIR%"
172172
:: by modifying this file and using goto.
173173
:Boost
174174
:: NOTE Boost < 1.64 doesn't work without tricks if the user has only VS 2017 installed and no earlier versions.
175-
set BOOST_VERSION=1.71.0
175+
set BOOST_VERSION=1.74.0
176176
:: Version string with underscores instead of dots.
177177
set BOOST_VER=%BOOST_VERSION:.=_%
178178
:: DEPENDENCY_NAME is used for logging and DEPENDENCY_DIR for saving from some redundant typing

win/run-cmake.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ IF NOT EXIST ..\%BUILD_DIR%. mkdir ..\%BUILD_DIR%
5959
pushd ..\%BUILD_DIR%
6060

6161
:: tfk: todo remove duplication
62-
set BOOST_VERSION=1.71.0
62+
set BOOST_VERSION=1.74.0
6363
set BOOST_VER=%BOOST_VERSION:.=_%
6464

6565
set BOOST_ROOT=%DEPS_DIR%\boost_%BOOST_VER%

0 commit comments

Comments
 (0)