From af56d50d64d0473f48dc7d4acfabc1b91265cf3b Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Tue, 26 May 2020 21:01:32 -0700 Subject: [libarchive] Disable C4061 which causes build to fail in Visual Studio 2019 16.6 (#11570) * [libarchive] Disable C4061 which causes build to fail in Visual Studio 2019 16.6 * Bump verison. --- ports/libarchive/CONTROL | 2 +- ports/libarchive/disable-c4061.patch | 14 ++++++++++++++ ports/libarchive/portfile.cmake | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 ports/libarchive/disable-c4061.patch diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index 425c2c72c..e3e821191 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,5 +1,5 @@ Source: libarchive -Version: 3.4.1-2 +Version: 3.4.1-3 Homepage: https://github.com/libarchive/libarchive Description: Library for reading and writing streaming archives Build-Depends: zlib diff --git a/ports/libarchive/disable-c4061.patch b/ports/libarchive/disable-c4061.patch new file mode 100644 index 000000000..e09c9ca6e --- /dev/null +++ b/ports/libarchive/disable-c4061.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 911ae5b..0e12b56 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -151,9 +151,6 @@ IF (MSVC) + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" +- # Enable level 4 C4061: The enumerate has no associated handler in a switch +- # statement. +- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") diff --git a/ports/libarchive/portfile.cmake b/ports/libarchive/portfile.cmake index 82834f5d0..a9bb4955c 100644 --- a/ports/libarchive/portfile.cmake +++ b/ports/libarchive/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( fix-lz4.patch fix-zstd.patch fix-cpu-set.patch + disable-c4061.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -84,4 +85,4 @@ foreach(HEADER ${CURRENT_PACKAGES_DIR}/include/archive.h ${CURRENT_PACKAGES_DIR} file(WRITE ${HEADER} "${CONTENTS}") endforeach() -file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -- cgit v1.2.3