Skip to content

Commit

Permalink
Merge pull request #112 from Cyan4973/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Cyan4973 committed Jan 12, 2016
2 parents 0022b34 + e06e1e9 commit a6a6775
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 102 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
language: c

before_install:
- "wget https://launchpad.net/ubuntu/+source/cmake/2.8.8-2ubuntu1/+build/3441442/+files/cmake_2.8.8-2ubuntu1_amd64.deb"
- "wget https://launchpad.net/ubuntu/+archive/primary/+files/cmake-data_2.8.8-2ubuntu1_all.deb"
- "sudo apt-get remove cmake-data cmake"
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-arm-linux-gnueabi
- sudo apt-get install -qq clang
- sudo apt-get install -qq g++-multilib
- sudo apt-get install -qq gcc-multilib
- sudo apt-get install -qq valgrind

install:
- "sudo dpkg --install cmake-data_2.8.8-2ubuntu1_all.deb cmake_2.8.8-2ubuntu1_amd64.deb"

env:
- ZSTD_TRAVIS_CI_ENV=travis-install
- ZSTD_TRAVIS_CI_ENV=cmaketest
Expand All @@ -34,4 +28,4 @@ script:
- make $ZSTD_TRAVIS_CI_ENV

matrix:
fast_finish: true
fast_finish: true
14 changes: 6 additions & 8 deletions contrib/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# ################################################################

PROJECT(zstd)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)

OPTION(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)

Expand All @@ -44,14 +44,12 @@ ELSE (ZSTD_LEGACY_SUPPORT)
ADD_DEFINITIONS(-DZSTD_LEGACY_SUPPORT=0)
ENDIF (ZSTD_LEGACY_SUPPORT)

INCLUDE(CMakeModules/CompareVersion.cmake)
COMPARE_VERSION_STRINGS("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" "2.8.8" CMP_RESULT)

IF ((CMP_RESULT LESS 0) OR (CMP_RESULT EQUAL 0))
SET(USE_DEPRECATED_CODE_STYLE TRUE)
# TARGET_INCLUDE_DIRECTORIES can use in version 2.8.11 and greate
IF ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} EQUAL 8) AND (${CMAKE_PATCH_VERSION} LESS 11))
SET(WORKAROUND_OUTDATED_CODE_STYLE TRUE)
ELSE ()
SET(USE_DEPRECATED_CODE_STYLE FALSE)
ENDIF ((CMP_RESULT LESS 0) OR (CMP_RESULT EQUAL 0))
SET(WORKAROUND_OUTDATED_CODE_STYLE FALSE)
ENDIF ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} EQUAL 8) AND (${CMAKE_PATCH_VERSION} LESS 11))

ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(programs)
Expand Down
70 changes: 0 additions & 70 deletions contrib/cmake/CMakeModules/CompareVersion.cmake

This file was deleted.

18 changes: 5 additions & 13 deletions contrib/cmake/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
# - Public forum : https://groups.google.com/forum/#!forum/lz4c
# ################################################################

IF (USE_DEPRECATED_CODE_STYLE)
IF (POLICY CMP0021)
cmake_policy(SET CMP0021 OLD)
ENDIF ()
ENDIF (USE_DEPRECATED_CODE_STYLE)

# Get library version based on information from input content (use regular exp)
function(GetLibraryVersion _content _outputVar1 _outputVar2 _outputVar3)
string(REGEX MATCHALL ".*define ZSTD_VERSION_MAJOR+.* ([0-9]+).*define ZSTD_VERSION_MINOR+.* ([0-9]+).*define ZSTD_VERSION_RELEASE+.* ([0-9]+)" VERSION_REGEX "${_content}")
Expand Down Expand Up @@ -115,17 +109,15 @@ IF (MSVC)
SET_TARGET_PROPERTIES(libzstd_shared PROPERTIES COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS")
ENDIF (MSVC)

IF (NOT USE_DEPRECATED_CODE_STYLE)
# Define include directories
IF (NOT WORKAROUND_OUTDATED_CODE_STYLE)
TARGET_INCLUDE_DIRECTORIES(libzstd_static PUBLIC ${LIBRARY_DIR})
TARGET_INCLUDE_DIRECTORIES(libzstd_shared PUBLIC ${LIBRARY_DIR})
ENDIF (NOT USE_DEPRECATED_CODE_STYLE)

IF (ZSTD_LEGACY_SUPPORT)
IF (NOT USE_DEPRECATED_CODE_STYLE)
IF (ZSTD_LEGACY_SUPPORT)
TARGET_INCLUDE_DIRECTORIES(libzstd_static PUBLIC ${LIBRARY_LEGACY_DIR})
TARGET_INCLUDE_DIRECTORIES(libzstd_shared PUBLIC ${LIBRARY_LEGACY_DIR})
ENDIF (NOT USE_DEPRECATED_CODE_STYLE)
ENDIF (ZSTD_LEGACY_SUPPORT)
ENDIF (ZSTD_LEGACY_SUPPORT)
ENDIF (NOT WORKAROUND_OUTDATED_CODE_STYLE)

# Define library base name
IF (UNIX)
Expand Down
8 changes: 4 additions & 4 deletions contrib/cmake/programs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ SET(ROOT_DIR ../../..)
SET(PROGRAMS_DIR ${ROOT_DIR}/programs)
INCLUDE_DIRECTORIES(${PROGRAMS_DIR})

IF (USE_DEPRECATED_CODE_STYLE)
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})
ENDIF (USE_DEPRECATED_CODE_STYLE)
ENDIF (WORKAROUND_OUTDATED_CODE_STYLE)

IF (ZSTD_LEGACY_SUPPORT)
SET(PROGRAMS_LEGACY_DIR ${PROGRAMS_DIR}/legacy)
INCLUDE_DIRECTORIES(${PROGRAMS_LEGACY_DIR})

IF (USE_DEPRECATED_CODE_STYLE)
IF (WORKAROUND_OUTDATED_CODE_STYLE)
INCLUDE_DIRECTORIES(${LIBRARY_DIR}/legacy)
ENDIF (USE_DEPRECATED_CODE_STYLE)
ENDIF (WORKAROUND_OUTDATED_CODE_STYLE)

SET(ZSTD_FILEIO_LEGACY ${PROGRAMS_LEGACY_DIR}/fileio_legacy.c)
ENDIF (ZSTD_LEGACY_SUPPORT)
Expand Down

0 comments on commit a6a6775

Please sign in to comment.