externals: Make catch an interface target

Eliminates top-level inclusion of the headers with include_directories()
and instead utilizes it on a by-target basis using target_include_directories().
This commit is contained in:
Lioncash 2017-02-25 12:31:53 -05:00 committed by Merry
parent 2449468ede
commit f9e7e85308
3 changed files with 7 additions and 4 deletions

View file

@ -111,9 +111,8 @@ else()
endif()
include_directories(${Boost_INCLUDE_DIRS})
# Include Catch
include_directories(externals/catch)
enable_testing(true) # Enables unit-testing.
# Enable unit-testing.
enable_testing(true)
# Include LLVM
if (DYNARMIC_USE_LLVM)

View file

@ -13,3 +13,7 @@ if (NOT TARGET xbyak)
target_include_directories(xbyak INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/xbyak/xbyak)
endif()
endif()
add_library(catch INTERFACE)
target_include_directories(catch INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/catch>)

View file

@ -35,7 +35,7 @@ include(CreateDirectoryGroups)
create_directory_groups(${SRCS} ${HEADERS})
add_executable(dynarmic_tests ${SRCS})
target_link_libraries(dynarmic_tests dynarmic ${llvm_libs})
target_link_libraries(dynarmic_tests dynarmic catch ${llvm_libs})
set_target_properties(dynarmic_tests PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(dynarmic_tests PRIVATE . ../src)
target_compile_options(dynarmic_tests PRIVATE ${DYNARMIC_CXX_FLAGS})