CMakeLists: Fixup boost

* boost is part of the public interface.
* Consider boost a system library so warnings from boost do not cause a build failure.
* If the parent project defines boost, use that.
This commit is contained in:
MerryMage 2017-12-07 20:28:33 +00:00
parent 4f8675083c
commit 0af1e7723d
3 changed files with 9 additions and 9 deletions

View file

@ -17,6 +17,6 @@ matrix:
script: ./.travis/build-x86_64-linux.sh
- os: osx
sudo: false
osx_image: xcode7.3
osx_image: xcode9.2
install: ./.travis/deps-x86_64-macos.sh
script: ./.travis/build-x86_64-macos.sh

View file

@ -104,15 +104,14 @@ endif()
message(STATUS "Target architecture: ${ARCHITECTURE}")
# Include Boost
if(DYNARMIC_USE_SYSTEM_BOOST)
find_package(Boost 1.57.0 REQUIRED)
else()
if (NOT TARGET boost)
if (NOT Boost_INCLUDE_DIRS)
message(FATAL_ERROR "Please provide a path to a boost installation using Boost_INCLUDE_DIRS")
endif()
find_package(Boost 1.57.0 REQUIRED)
endif()
add_library(boost INTERFACE IMPORTED)
set_property(TARGET boost PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
set_property(TARGET boost PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
endif()
# Enable unit-testing.
enable_testing(true)

View file

@ -112,8 +112,9 @@ target_include_directories(dynarmic
PRIVATE .)
target_compile_options(dynarmic PRIVATE ${DYNARMIC_CXX_FLAGS})
target_link_libraries(dynarmic
PRIVATE
PUBLIC
boost
PRIVATE
fmt::fmt
xbyak
$<$<BOOL:DYNARMIC_USE_LLVM>:${llvm_libs}>