diff --git a/SuperBuild/External_Boost.cmake b/SuperBuild/External_Boost.cmake index 1c2e9ea3..e2ad6c73 100644 --- a/SuperBuild/External_Boost.cmake +++ b/SuperBuild/External_Boost.cmake @@ -108,13 +108,18 @@ if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalPr ) endif() +if (NOT WIN32) # Avoid linking problems with boost system, specifically # boost::system::detail::generic_category_instance # by forcing Boost to use an inline variable, as opposed to # the instantiated variable in the library # See https://github.com/SyneRBI/SIRF-SuperBuild/issues/161 +# However, this solution is flawed as it overrides any system compiler flags, see +# https://github.com/SyneRBI/SIRF-SuperBuild/issues/455 +# Probably should check if it's still necessary for recent Boost. set(Boost_CMAKE_ARGS ${Boost_CMAKE_ARGS} -DCMAKE_CXX_FLAGS:STRING=-DBOOST_ERROR_CODE_HEADER_ONLY\ -DBOOST_SYSTEM_NO_DEPRECATED) +endif() mark_as_superbuild( VARS