mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 11:21:12 +08:00
[BZip2] Fix Unix Dynamic Builds (#5184)
* [BZip2] Fix Unix Dynamic Builds * [bzip2] Bump control version * [libgta] Only build one flavor * [vcpkg_configure_cmake] Resolve #2375 since we now use CMake >= 3.11
This commit is contained in:
parent
cde34211a5
commit
e6552f1180
@ -5,7 +5,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
add_definitions(-DBZ_DEBUG) # enable extra assertions
|
||||
endif()
|
||||
|
||||
set(LIBBZ2_SOURCES
|
||||
set(BZ2_SOURCES
|
||||
blocksort.c
|
||||
huffman.c
|
||||
crctable.c
|
||||
@ -14,12 +14,13 @@ set(LIBBZ2_SOURCES
|
||||
decompress.c
|
||||
bzlib.c)
|
||||
|
||||
add_library(libbz2 ${LIBBZ2_SOURCES})
|
||||
set_target_properties(libbz2 PROPERTIES
|
||||
ARCHIVE_OUTPUT_NAME bz2 # required for FindBzip2 to work
|
||||
DEBUG_POSTFIX d)
|
||||
add_library(bz2 ${BZ2_SOURCES})
|
||||
set_target_properties(bz2 PROPERTIES
|
||||
DEBUG_POSTFIX d
|
||||
VERSION 1.0.6
|
||||
SOVERSION 1.0)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(libbz2 PRIVATE -DBZ_BUILD_DLL)
|
||||
target_compile_definitions(bz2 PRIVATE -DBZ_BUILD_DLL)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
@ -28,14 +29,14 @@ if(MSVC)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
|
||||
install(TARGETS libbz2
|
||||
install(TARGETS bz2
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib)
|
||||
|
||||
if(NOT BZIP2_SKIP_TOOLS)
|
||||
add_executable(bzip2 bzip2.c ${LIBBZ2_SOURCES})
|
||||
add_executable(bzip2recover bzip2recover.c ${LIBBZ2_SOURCES})
|
||||
add_executable(bzip2 bzip2.c ${BZ2_SOURCES})
|
||||
add_executable(bzip2recover bzip2recover.c ${BZ2_SOURCES})
|
||||
install(TARGETS bzip2 bzip2recover DESTINATION tools/bzip2)
|
||||
endif()
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
Source: bzip2
|
||||
Version: 1.0.6-3
|
||||
Version: 1.0.6-4
|
||||
Description: High-quality data compressor.
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: libgta
|
||||
Version: 1.0.8
|
||||
Version: 1.0.8-1
|
||||
Description: Libgta is a portable library that implements the Generic Tagged Array (GTA) file format.
|
||||
Build-Depends: bzip2, zlib, liblzma
|
||||
|
@ -1,16 +1,18 @@
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
set(LIBGTA_VERSION 1.0.8)
|
||||
set(LIBGTA_HASH 99ec3d6317c9a12cf440a60bb989cc7a3fe35e0a1da3e65206e5cd52b69fb860850e61ea0f819511ef48ddc87c468c0ded710409990627096738886e1b358423)
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libgta-${LIBGTA_VERSION})
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "http://download.savannah.nongnu.org/releases/gta/libgta-1.0.8.tar.xz"
|
||||
FILENAME "libgta-${LIBGTA_VERSION}.tar.xz"
|
||||
SHA512 ${LIBGTA_HASH})
|
||||
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
REF ${LIBGTA_VERSION}
|
||||
)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ENABLE_SHARED_LIBS)
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC_LIBS)
|
||||
@ -18,12 +20,11 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC_LIBS)
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS -DGTA_BUILD_SHARED_LIBS=${ENABLE_SHARED_LIBS}
|
||||
-DGTA_BUILD_STATIC_LIBS=${ENABLE_STATIC_LIBS}
|
||||
OPTIONS -DGTA_BUILD_SHARED_LIB=${ENABLE_SHARED_LIBS}
|
||||
-DGTA_BUILD_STATIC_LIB=${ENABLE_STATIC_LIBS}
|
||||
-DGTA_BUILD_DOCUMENTATION=OFF
|
||||
)
|
||||
|
||||
vcpkg_build_cmake()
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
|
@ -77,9 +77,6 @@ function(vcpkg_configure_cmake)
|
||||
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
# Ninja and MSBuild have many differences when targetting UWP, so use MSBuild to maximize existing compatibility
|
||||
set(NINJA_CAN_BE_USED OFF)
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
||||
# Arm64 usage should be allowed once github issue #2375 is resolved
|
||||
set(NINJA_CAN_BE_USED OFF)
|
||||
endif()
|
||||
|
||||
if(_csc_GENERATOR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user