From 3b95e90555f4dfaaa10e7b385fdbac6fa81d599f Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Tue, 30 Oct 2018 22:29:07 -0400 Subject: [PATCH] Use -DBOOST_ALL_NO_LIB on Windows (disable autolinking). --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 054cf2dc27..1e5aec95ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,12 +325,10 @@ find_package(Boost 1.49 link_directories(${Boost_LIBRARY_DIRS}) -# In Visual Studio, automatic linking is performed, so we don't need to worry -# about it. Clear the list of libraries to link against and let Visual Studio -# handle it. +# Disable automatic linking in Visual Studio. if (MSVC) link_directories(${Boost_LIBRARY_DIRS}) - set(Boost_LIBRARIES "") + add_definitions(-DBOOST_ALL_NO_LIB) endif () set(MLPACK_INCLUDE_DIRS ${MLPACK_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})