cmake project works with MSYS

This commit is contained in:
inikep 2016-05-31 13:36:14 +02:00
parent f772bf54a5
commit 5bee32e349
6 changed files with 14 additions and 25 deletions

2
.gitignore vendored
View File

@ -34,4 +34,4 @@ _zstdbench/
zlib_wrapper/ zlib_wrapper/
# CMake # CMake
contrib/cmake/ projects/cmake/

View File

@ -33,7 +33,7 @@
DESTDIR?= DESTDIR?=
PREFIX ?= /usr/local PREFIX ?= /usr/local
CPPFLAGS= -I../lib/common CPPFLAGS= -I../lib/common -I../lib/dictBuilder
CFLAGS ?= -O3 # -falign-loops=32 # not always beneficial CFLAGS ?= -O3 # -falign-loops=32 # not always beneficial
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wstrict-prototypes -Wundef CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wstrict-prototypes -Wundef
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS) FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)

View File

@ -32,7 +32,7 @@
/*-************************************* /*-*************************************
* Dependencies * Dependencies
***************************************/ ***************************************/
#include "../lib/dictBuilder/zdict_static.h" /* ZDICT_params_t */ #include "zdict_static.h" /* ZDICT_params_t */
/*-************************************* /*-*************************************

View File

@ -165,7 +165,7 @@ static int basicUnitTests(U32 seed, double compressibility, ZSTD_customMem custo
/* generate skippable frame */ /* generate skippable frame */
MEM_writeLE32(compressedBuffer, ZSTD_MAGIC_SKIPPABLE_START); MEM_writeLE32(compressedBuffer, ZSTD_MAGIC_SKIPPABLE_START);
MEM_writeLE32(compressedBuffer+4, (U32)skippableFrameSize); MEM_writeLE32(((char*)compressedBuffer)+4, (U32)skippableFrameSize);
cSize = skippableFrameSize + 8; cSize = skippableFrameSize + 8;
/* Basic compression test */ /* Basic compression test */
DISPLAYLEVEL(4, "test%3i : compress %u bytes : ", testNb++, COMPRESSIBLE_NOISE_LENGTH); DISPLAYLEVEL(4, "test%3i : compress %u bytes : ", testNb++, COMPRESSIBLE_NOISE_LENGTH);

View File

@ -105,11 +105,6 @@ IF (ZSTD_LEGACY_SUPPORT)
${LIBRARY_LEGACY_DIR}/zstd_v04.h) ${LIBRARY_LEGACY_DIR}/zstd_v04.h)
ENDIF (ZSTD_LEGACY_SUPPORT) 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 # Split project to static and shared libraries build
ADD_LIBRARY(libzstd_static STATIC ${Sources} ${Headers} ${PlatformDependResources}) ADD_LIBRARY(libzstd_static STATIC ${Sources} ${Headers} ${PlatformDependResources})
ADD_LIBRARY(libzstd_shared SHARED ${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) ENDIF (NOT WORKAROUND_OUTDATED_CODE_STYLE)
# Define library base name # Define library base name
IF (UNIX) IF (MSVC)
SET(LIBRARY_BASE_NAME libzstd)
ELSEIF (MSVC)
SET(LIBRARY_BASE_NAME zstdlib) SET(LIBRARY_BASE_NAME zstdlib)
ELSE () ELSE ()
MESSAGE(FATAL_ERROR "Unsupported build type") SET(LIBRARY_BASE_NAME libzstd)
ENDIF (UNIX) ENDIF (MSVC)
# Define static and shared library names # Define static and shared library names
SET(STATIC_LIBRARY_OUTPUT_NAME ${LIBRARY_BASE_NAME}) SET(STATIC_LIBRARY_OUTPUT_NAME ${LIBRARY_BASE_NAME})

View File

@ -38,14 +38,10 @@ SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
SET(ROOT_DIR ../../..) SET(ROOT_DIR ../../..)
# Define programs directory, where sources and header files are located # Define programs directory, where sources and header files are located
SET(LIBRARY_DIR ${ROOT_DIR}/lib)
SET(PROGRAMS_DIR ${ROOT_DIR}/programs) 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) IF (ZSTD_LEGACY_SUPPORT)
SET(PROGRAMS_LEGACY_DIR ${PROGRAMS_DIR}/legacy) SET(PROGRAMS_LEGACY_DIR ${PROGRAMS_DIR}/legacy)