diff options
| author | Alexander Karatarakis <alex@karatarakis.com> | 2017-08-10 14:26:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-10 14:26:18 -0700 |
| commit | b2b41fbf18b140e9f69e1e9aec0f125516fbe743 (patch) | |
| tree | edce953c606e5b679067d64445566e257c6cbc43 | |
| parent | 8024832558d30be71c4273fd815104de8df80ca0 (diff) | |
| parent | 215f205700b0af10205f7bbde879cb6c8f5c2b1a (diff) | |
| download | vcpkg-b2b41fbf18b140e9f69e1e9aec0f125516fbe743.tar.gz vcpkg-b2b41fbf18b140e9f69e1e9aec0f125516fbe743.zip | |
Merge pull request #1580 from codicodi/physfs-fix
[physfs] enable static builds, use external zlib
| -rw-r--r-- | ports/physfs/CONTROL | 3 | ||||
| -rw-r--r-- | ports/physfs/export-symbols-in-shared-build-only.patch | 13 | ||||
| -rw-r--r-- | ports/physfs/portfile.cmake | 34 |
3 files changed, 32 insertions, 18 deletions
diff --git a/ports/physfs/CONTROL b/ports/physfs/CONTROL index 3e502435f..5eac58c36 100644 --- a/ports/physfs/CONTROL +++ b/ports/physfs/CONTROL @@ -1,3 +1,4 @@ Source: physfs -Version: 2.0.3 +Version: 2.0.3-1 Description: a library to provide abstract access to various archives +Build-Depends: zlib diff --git a/ports/physfs/export-symbols-in-shared-build-only.patch b/ports/physfs/export-symbols-in-shared-build-only.patch new file mode 100644 index 000000000..b3303dcd8 --- /dev/null +++ b/ports/physfs/export-symbols-in-shared-build-only.patch @@ -0,0 +1,13 @@ +diff --git a/physfs.h b/physfs.h +index 3c252c6..4319981 100644 +--- a/physfs.h ++++ b/physfs.h +@@ -221,7 +221,7 @@ extern "C" { + #endif + + #ifndef DOXYGEN_SHOULD_IGNORE_THIS +-#if (defined _MSC_VER) ++#if (defined _MSC_VER && defined (physfs_EXPORTS)) + #define __EXPORT__ __declspec(dllexport) + #elif (__GNUC__ >= 3) + #define __EXPORT__ __attribute__((visibility("default"))) diff --git a/ports/physfs/portfile.cmake b/ports/physfs/portfile.cmake index 082cc7740..4e00a43fc 100644 --- a/ports/physfs/portfile.cmake +++ b/ports/physfs/portfile.cmake @@ -1,32 +1,32 @@ -# Common Ambient Variables: -# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> -# TARGET_TRIPLET is the current triplet (x86-windows, etc) -# PORT is the current port name (zlib, etc) -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# - -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building not supported yet. Building dynamic.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/physfs-2.0.3) +set(PHYSFS_VERSION 2.0.3) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/physfs-${PHYSFS_VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "https://icculus.org/physfs/downloads/physfs-2.0.3.tar.bz2" - FILENAME "physfs-2.0.3.tar.bz2" + URLS "https://icculus.org/physfs/downloads/physfs-${PHYSFS_VERSION}.tar.bz2" + FILENAME "physfs-${PHYSFS_VERSION}.tar.bz2" SHA512 47eff0c81b8dc3bb526766b0a8ad2437d2951867880116d6e6e8f2ec1490e263541fb741867fed6517cc3fa8a9c5651b36e3e02a499f19cfdc5c7261c9707e80 ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} + PATCHES ${CMAKE_CURRENT_LIST_DIR}/export-symbols-in-shared-build-only.patch) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PHYSFS_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PHYSFS_SHARED) + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DPHYSFS_BUILD_STATIC=${PHYSFS_STATIC} + -DPHYSFS_BUILD_SHARED=${PHYSFS_SHARED} + -DPHYSFS_BUILD_TEST=OFF ) vcpkg_install_cmake() +vcpkg_copy_pdbs() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/test_physfs.exe) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/test_physfs.exe) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/physfs) |
