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 script: ./.travis/build-x86_64-linux.sh
- os: osx - os: osx
sudo: false sudo: false
osx_image: xcode7.3 osx_image: xcode9.2
install: ./.travis/deps-x86_64-macos.sh install: ./.travis/deps-x86_64-macos.sh
script: ./.travis/build-x86_64-macos.sh script: ./.travis/build-x86_64-macos.sh

View file

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

View file

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