Create xxhash_impl.{c,h} for ease of use & universal builds

This commit is contained in:
Luke Street 2022-02-27 11:05:48 -05:00
parent b02ec12049
commit ad1453ac08
4 changed files with 11 additions and 8 deletions

View File

@ -4,10 +4,7 @@
#include <utility>
#include <dawn/webgpu_cpp.h>
#include <xxhash.h>
#if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64)
#include <xxh_x86dispatch.h>
#endif
#include <xxhash_impl.h>
#ifndef ALIGN
#define ALIGN(x, a) (((x) + ((a)-1)) & ~((a)-1))

View File

@ -1,6 +1,3 @@
add_library(xxhash xxhash.c)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
target_sources(xxhash PRIVATE xxh_x86dispatch.c)
endif ()
add_library(xxhash xxhash_impl.c)
target_include_directories(xxhash PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(xxhash INTERFACE XXH_STATIC_LINKING_ONLY)

4
extern/xxhash/xxhash_impl.c vendored Normal file
View File

@ -0,0 +1,4 @@
#if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64)
#include "xxh_x86dispatch.c"
#endif
#include "xxhash.c"

5
extern/xxhash/xxhash_impl.h vendored Normal file
View File

@ -0,0 +1,5 @@
#if defined(__x86_64__) || defined(__i386__) || defined(_M_IX86) || defined(_M_X64)
#include "xxh_x86dispatch.h"
#else
#include "xxhash.h"
#endif