Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to use bzip2 1.0.8 on windows #2332

Merged
merged 6 commits into from Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmake/Modules/FindBzip2_EP.cmake
Expand Up @@ -79,10 +79,12 @@ if (NOT BZIP2_FOUND)
if (WIN32)
ExternalProject_Add(ep_bzip2
PREFIX "externals"
URL "https://github.com/TileDB-Inc/bzip2-windows/releases/download/v1.0.6/bzip2-1.0.6.zip"
URL_HASH SHA1=d11c3f0be92805a4c35f384845beb99eb6a96f6e
URL "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
URL_HASH SHA1=bf7badf7e248e0ecf465d33c2f5aeec774209227
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX}
UPDATE_COMMAND ""
PATCH_COMMAND
${CMAKE_COMMAND} -E copy ${TILEDB_CMAKE_INPUTS_DIR}/patches/ep_bzip2/CMakeLists.txt ${CMAKE_CURRENT_BINARY_DIR}/externals/src/ep_bzip2
LOG_DOWNLOAD TRUE
LOG_CONFIGURE TRUE
LOG_BUILD TRUE
Expand Down
55 changes: 55 additions & 0 deletions cmake/inputs/patches/ep_bzip2/CMakeLists.txt
@@ -0,0 +1,55 @@
#
# CMakeLists.txt
#
#
# The MIT License
#
# Copyright (c) 2017 TileDB, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

project(bzip2)
cmake_minimum_required(VERSION 2.8)

set(SOURCES "blocksort.c" "huffman.c" "crctable.c" "randtable.c"
"compress.c" "decompress.c" "bzlib.c")
file(GLOB HEADERS "bzlib.h")

# Set build flags
if (WIN32)
ihnorton marked this conversation as resolved.
Show resolved Hide resolved
set(CMAKE_C_FLAGS "/DWIN32 /D_FILE_OFFSET_BITS=64 /MD /Ox /nologo")
else()
set(CMAKE_C_FLAGS "-D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -g")
endif()

# Create libraries
add_library(bzip2_static STATIC ${SOURCES})
set_target_properties(bzip2_static PROPERTIES OUTPUT_NAME "libbz2static")
add_library(bzip2_shared SHARED ${SOURCES} libbz2.def)
set_target_properties(bzip2_shared PROPERTIES OUTPUT_NAME "libbz2")

# Install libraries
install(
TARGETS bzip2_static bzip2_shared
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES ${HEADERS} DESTINATION include)