transferred implementation inside xxhash.h

instead of xxhash.c .

This seems preferable for some build systems,
which don't like the `#include "xxhash.c"` statement
when inlining xxhash, as reported by @pdillinger .

Note that `xxhash.c` still exists,
it just includes the implementation and instantiates it.
This commit is contained in:
Yann Collet 2019-11-04 15:53:35 -08:00
parent 44cd858d49
commit a642aba0f5
4 changed files with 1099 additions and 1092 deletions

View File

@ -339,6 +339,7 @@ install: lib xxhsum ## install libraries, CLI, links and man page
@ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT)
@$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR) # includes
@$(INSTALL_DATA) xxhash.h $(DESTDIR)$(INCLUDEDIR)
@$(INSTALL_DATA) xxh3.h $(DESTDIR)$(INCLUDEDIR)
@echo Installing xxhsum
@$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
@$(INSTALL_PROGRAM) xxhsum $(DESTDIR)$(BINDIR)/xxhsum

View File

@ -44,7 +44,6 @@ if(NOT CMAKE_CONFIGURATION_TYPES)
endif()
option(BUILD_SHARED_LIBS "Build shared library" ON)
set(XXHASH_BUILD_ENABLE_INLINE_API ON CACHE BOOL "add xxhash.c to includes for -DXXH_INLINE_ALL")
set(XXHASH_BUILD_XXHSUM ON CACHE BOOL "Build the xxhsum binary")
# If XXHASH is being bundled in another project, we don't want to
@ -123,10 +122,8 @@ if(NOT XXHASH_BUNDLED_MODE)
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
install(FILES "${XXHASH_DIR}/xxhash.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
if(XXHASH_BUILD_ENABLE_INLINE_API)
install(FILES "${XXHASH_DIR}/xxhash.c"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif()
install(FILES "${XXHASH_DIR}/xxh3.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
if(XXHASH_BUILD_XXHSUM)
install(TARGETS xxhsum
EXPORT xxHashTargets

1074
xxhash.c

File diff suppressed because it is too large Load Diff

1109
xxhash.h

File diff suppressed because it is too large Load Diff