CMake: Re-use external xbyak target if present (#62)

This commit is contained in:
Yuri Kunde Schlesner 2016-12-12 06:23:42 -08:00 committed by Merry
parent 5bea2e1680
commit 34e19f135c
3 changed files with 8 additions and 3 deletions

View file

@ -96,9 +96,6 @@ include_directories(${Boost_INCLUDE_DIRS})
include_directories(externals/catch)
enable_testing(true) # Enables unit-testing.
# Include Xbyak
include_directories(externals/xbyak/xbyak)
# Include LLVM
if (DYNARMIC_USE_LLVM)
find_package(LLVM REQUIRED CONFIG)

View file

@ -6,3 +6,10 @@ if (NOT DYNARMIC_NO_BUNDLED_FMT)
# fmtlib formatting library
add_subdirectory(fmt)
endif()
if (NOT TARGET xbyak)
if (ARCHITECTURE_x86 OR ARCHITECTURE_x86_64)
add_library(xbyak INTERFACE)
target_include_directories(xbyak INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/xbyak/xbyak)
endif()
endif()

View file

@ -107,3 +107,4 @@ target_link_libraries(dynarmic PRIVATE fmt-header-only)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(dynarmic PRIVATE FMT_USE_WINDOWS_H=0)
endif()
target_link_libraries(dynarmic PRIVATE xbyak)