From af3b2b0e154443395ee4db357c465d5c10e77b7f Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 26 Dec 2020 00:41:59 +1000 Subject: [PATCH] Build: Fix xxhash on non-Windows --- dep/xxhash/CMakeLists.txt | 9 ++++++++- dep/xxhash/xxhash.vcxproj | 14 ++++++++++++-- src/core/CMakeLists.txt | 2 +- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/dep/xxhash/CMakeLists.txt b/dep/xxhash/CMakeLists.txt index 19192ea7f..bee7de896 100644 --- a/dep/xxhash/CMakeLists.txt +++ b/dep/xxhash/CMakeLists.txt @@ -1,10 +1,17 @@ set(SRCS - include/xxh3.h include/xxhash.h src/xxhash.c ) add_library(xxhash ${SRCS}) + +if(${CPU_ARCH} STREQUAL "x86" OR ${CPU_ARCH} STREQUAL "x64") + target_sources(xxhash PRIVATE + include/xxh_x86dispatch.h + src/xxh_x86dispatch.c + ) +endif() + target_include_directories(xxhash PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(xxhash INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_compile_definitions(xxhash INTERFACE "XXH_STATIC_LINKING_ONLY") diff --git a/dep/xxhash/xxhash.vcxproj b/dep/xxhash/xxhash.vcxproj index ffa57c2bd..4c8d0ee0c 100644 --- a/dep/xxhash/xxhash.vcxproj +++ b/dep/xxhash/xxhash.vcxproj @@ -52,11 +52,21 @@ - + + true + true + true + true + - + + true + true + true + true + {09553C96-9F39-49BF-8AE6-7ACBD07C410C} diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 1180558dd..77f909a04 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -114,7 +114,7 @@ set(RECOMPILER_SRCS target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_link_libraries(core PUBLIC Threads::Threads common zlib vulkan-loader) -target_link_libraries(core PRIVATE glad stb) +target_link_libraries(core PRIVATE glad stb xxhash) if(WIN32) target_sources(core PRIVATE