Skip to content

Commit

Permalink
Do not use imported targets for Boost because they're continually bro…
Browse files Browse the repository at this point in the history
…ken. Part 2.
  • Loading branch information
ras0219-msft committed Sep 19, 2017
1 parent d065815 commit 23ac40a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Release/cmake/cpprest_find_boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,24 @@ function(cpprest_find_boost)
# FindBoost continually breaks imported targets whenever boost updates.
if(1)
target_include_directories(cpprestsdk_boost_internal INTERFACE "$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>")
target_link_libraries(cpprestsdk_boost_internal INTERFACE "$<BUILD_INTERFACE:${Boost_LIBRARIES}>")
set(_prev)
set(_libs)
foreach(_lib ${Boost_LIBRARIES})
if(_lib STREQUAL "optimized" OR _lib STREQUAL "debug")
else()
if(_prev STREQUAL "optimized")
list(APPEND _libs "$<$<NOT:$<CONFIG:Debug>>:${_lib}>")
elseif(_prev STREQUAL "debug")
list(APPEND _libs "$<$<CONFIG:Debug>:${_lib}>")
else()
list(APPEND _libs "${_lib}")
endif()
endif()
set(_prev "${_lib}")
endforeach()
message(STATUS "_libs: ${_libs}")
target_link_libraries(cpprestsdk_boost_internal INTERFACE "$<BUILD_INTERFACE:${_libs}>")

else()
if(ANDROID)
target_link_libraries(cpprestsdk_boost_internal INTERFACE
Expand Down

0 comments on commit 23ac40a

Please sign in to comment.