diff --git a/.gitignore b/.gitignore index 2d3b6917abc17fd3257c8d168f01ce0f2720b874..f0e2c9f12f842dc70720b2ca31104c90b9bb5d04 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,4 @@ _zstdbench/ zlib_wrapper/ # CMake -contrib/cmake/ +projects/cmake/ diff --git a/programs/Makefile b/programs/Makefile index f236459e8921f80070306347107cadb8b462d852..c57d8ec16f80ab8d8bca2786f91284a5fc68d0b3 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -33,7 +33,7 @@ DESTDIR?= PREFIX ?= /usr/local -CPPFLAGS= -I../lib/common +CPPFLAGS= -I../lib/common -I../lib/dictBuilder CFLAGS ?= -O3 # -falign-loops=32 # not always beneficial CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wstrict-prototypes -Wundef FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS) diff --git a/programs/dibio.h b/programs/dibio.h index fd1f21df0c129882a6d8eaae99caef6eb34137e9..0ccec4135daac52e02da2a64fdc598a6be23ab87 100644 --- a/programs/dibio.h +++ b/programs/dibio.h @@ -32,7 +32,7 @@ /*-************************************* * Dependencies ***************************************/ -#include "../lib/dictBuilder/zdict_static.h" /* ZDICT_params_t */ +#include "zdict_static.h" /* ZDICT_params_t */ /*-************************************* diff --git a/programs/zbufftest.c b/programs/zbufftest.c index 8d32bbcc87b94a54feac34b0ce5905fd7e669876..6e5b743940fe6af5c63b1a3e47a3d13c69103d72 100644 --- a/programs/zbufftest.c +++ b/programs/zbufftest.c @@ -165,7 +165,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo /* generate skippable frame */ MEM_writeLE32(compressedBuffer, ZSTD_MAGIC_SKIPPABLE_START); - MEM_writeLE32(compressedBuffer+4, (U32)skippableFrameSize); + MEM_writeLE32(((char*)compressedBuffer)+4, (U32)skippableFrameSize); cSize = skippableFrameSize + 8; /* Basic compression test */ DISPLAYLEVEL(4, "test%3i : compress %u bytes : ", testNb++, COMPRESSIBLE_NOISE_LENGTH); diff --git a/projects/cmake/lib/CMakeLists.txt b/projects/cmake/lib/CMakeLists.txt index dae706cbe6fc783f4536673bc5b5d3a6b1671469..c5557ff7441f7661bf7ce151e31ab8bd3b6b6d28 100644 --- a/projects/cmake/lib/CMakeLists.txt +++ b/projects/cmake/lib/CMakeLists.txt @@ -2,19 +2,19 @@ # zstd - Makefile # Copyright (C) Yann Collet 2014-2016 # All rights reserved. -# +# # BSD license # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: -# +# # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. -# +# # * Redistributions in binary form must reproduce the above copyright notice, this # list of conditions and the following disclaimer in the documentation and/or # other materials provided with the distribution. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -25,7 +25,7 @@ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# +# # You can contact the author at : # - zstd homepage : http://www.zstd.net/ # ################################################################ @@ -105,11 +105,6 @@ IF (ZSTD_LEGACY_SUPPORT) ${LIBRARY_LEGACY_DIR}/zstd_v04.h) ENDIF (ZSTD_LEGACY_SUPPORT) -IF (MSVC) - SET(MSVC_RESOURCE_DIR ${ROOT_DIR}/visual/2013/zstdlib) - SET(PlatformDependResources ${MSVC_RESOURCE_DIR}/resource.h ${MSVC_RESOURCE_DIR}/zstdlib.rc) -ENDIF (MSVC) - # Split project to static and shared libraries build ADD_LIBRARY(libzstd_static STATIC ${Sources} ${Headers} ${PlatformDependResources}) ADD_LIBRARY(libzstd_shared SHARED ${Sources} ${Headers} ${PlatformDependResources}) @@ -131,13 +126,11 @@ IF (NOT WORKAROUND_OUTDATED_CODE_STYLE) ENDIF (NOT WORKAROUND_OUTDATED_CODE_STYLE) # Define library base name -IF (UNIX) - SET(LIBRARY_BASE_NAME libzstd) -ELSEIF (MSVC) +IF (MSVC) SET(LIBRARY_BASE_NAME zstdlib) ELSE () - MESSAGE(FATAL_ERROR "Unsupported build type") -ENDIF (UNIX) + SET(LIBRARY_BASE_NAME libzstd) +ENDIF (MSVC) # Define static and shared library names SET(STATIC_LIBRARY_OUTPUT_NAME ${LIBRARY_BASE_NAME}) diff --git a/projects/cmake/programs/CMakeLists.txt b/projects/cmake/programs/CMakeLists.txt index 3b4f51d7923500b249d410bca715f74205ba8b6a..2670fc6a832db226304015095e5c4131a2a28d63 100644 --- a/projects/cmake/programs/CMakeLists.txt +++ b/projects/cmake/programs/CMakeLists.txt @@ -38,14 +38,10 @@ SET(CMAKE_INCLUDE_CURRENT_DIR TRUE) SET(ROOT_DIR ../../..) # Define programs directory, where sources and header files are located +SET(LIBRARY_DIR ${ROOT_DIR}/lib) SET(PROGRAMS_DIR ${ROOT_DIR}/programs) -INCLUDE_DIRECTORIES(${PROGRAMS_DIR}) +INCLUDE_DIRECTORIES(${PROGRAMS_DIR} ${LIBRARY_DIR}/common ${LIBRARY_DIR}/dictBuilder) -IF (WORKAROUND_OUTDATED_CODE_STYLE) - # Define library directory, where sources and header files are located - SET(LIBRARY_DIR ${ROOT_DIR}/lib) - INCLUDE_DIRECTORIES(${LIBRARY_DIR}/common) -ENDIF (WORKAROUND_OUTDATED_CODE_STYLE) IF (ZSTD_LEGACY_SUPPORT) SET(PROGRAMS_LEGACY_DIR ${PROGRAMS_DIR}/legacy)