mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 14:35:35 +08:00
Merge pull request #386 from willyd/gflags-2.2.0
Updated glfags to v2.2.0
This commit is contained in:
commit
d40d1adc96
@ -1,51 +0,0 @@
|
||||
From 5af642bdfe023a7c857d1d26593af586516bf696 Mon Sep 17 00:00:00 2001
|
||||
From: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu, 31 Dec 2015 17:16:26 +0500
|
||||
Subject: [PATCH] Fix some compilation warnings with MSVC 2015
|
||||
|
||||
MSVC 2015 already defines vsnprintf() and va_copy().
|
||||
---
|
||||
src/windows_port.cc | 2 ++
|
||||
src/windows_port.h | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/windows_port.cc b/src/windows_port.cc
|
||||
index 1f40458..b5b7194 100644
|
||||
--- a/src/windows_port.cc
|
||||
+++ b/src/windows_port.cc
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
// These call the windows _vsnprintf, but always NUL-terminate.
|
||||
#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */
|
||||
+#if !(defined(_MSC_VER) && _MSC_VER >= 1900) /* msvc 2015 already defines */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
@@ -68,4 +69,5 @@ int snprintf(char *str, size_t size, const char *format, ...) {
|
||||
return r;
|
||||
}
|
||||
|
||||
+#endif /* if !(defined(_MSC_VER) && _MSC_VER >= 1900) */
|
||||
#endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */
|
||||
diff --git a/src/windows_port.h b/src/windows_port.h
|
||||
index c8ff24f..554b9c9 100644
|
||||
--- a/src/windows_port.h
|
||||
+++ b/src/windows_port.h
|
||||
@@ -63,12 +63,14 @@
|
||||
* name vsnprintf, since windows defines that (but not snprintf (!)).
|
||||
*/
|
||||
#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */
|
||||
+#if !(defined(_MSC_VER) && _MSC_VER >= 1900) /* msvc 2015 already defines */
|
||||
extern GFLAGS_DLL_DECL int snprintf(char *str, size_t size,
|
||||
const char *format, ...);
|
||||
extern int GFLAGS_DLL_DECL safe_vsnprintf(char *str, size_t size,
|
||||
const char *format, va_list ap);
|
||||
#define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
|
||||
#define va_copy(dst, src) (dst) = (src)
|
||||
+#endif
|
||||
#endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
--
|
||||
2.10.0.windows.1
|
||||
|
@ -1,3 +1,3 @@
|
||||
Source: gflags
|
||||
Version: 2.1.2
|
||||
Version: 2.2.0-1
|
||||
Description: A C++ library that implements commandline flags processing
|
||||
|
@ -1,38 +1,21 @@
|
||||
include(vcpkg_common_functions)
|
||||
find_program(GIT git)
|
||||
|
||||
set(GIT_URL "https://github.com/gflags/gflags.git")
|
||||
set(GIT_TAG "v2.1.2")
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://github.com/gflags/gflags/archive/v2.2.0.zip"
|
||||
FILENAME "gflags-v2.2.0.zip"
|
||||
SHA512 638d094cdcc759a35ebd0e57900216deec6113242d2dcc964beff7b88cf56e3dbab3dce6e10a055bfd94cb5daebb8632382219a5ef40a689e14c76b263d3eca5)
|
||||
|
||||
if(NOT EXISTS "${DOWNLOADS}/gflags.git")
|
||||
message(STATUS "Cloning")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/gflags.git
|
||||
WORKING_DIRECTORY ${DOWNLOADS}
|
||||
LOGNAME clone
|
||||
)
|
||||
endif()
|
||||
message(STATUS "Cloning done")
|
||||
vcpkg_extract_source_archive(${ARCHIVE})
|
||||
|
||||
if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
|
||||
message(STATUS "Adding worktree and patching")
|
||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR})
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_TAG}
|
||||
WORKING_DIRECTORY ${DOWNLOADS}/gflags.git
|
||||
LOGNAME worktree
|
||||
)
|
||||
message(STATUS "Patching")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-some-compilation-warnings-with-MSVC-2015.patch --ignore-whitespace --whitespace=fix
|
||||
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src
|
||||
LOGNAME patch
|
||||
)
|
||||
endif()
|
||||
message(STATUS "Adding worktree and patching done")
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gflags-2.2.0)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS
|
||||
-DGFLAGS_REGISTER_BUILD_DIR:BOOL=OFF
|
||||
-DGFLAGS_REGISTER_INSTALL_PREFIX:BOOL=OFF
|
||||
-DBUILD_gflags_nothreads_LIB:BOOL=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
@ -40,33 +23,31 @@ vcpkg_install_cmake()
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/bin/gflags.dll)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/bin/gflags_nothreads.dll)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags.dll)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/gflags_nothreads.dll ${CURRENT_PACKAGES_DIR}/debug/bin/gflags_nothreads.dll)
|
||||
endif()
|
||||
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/cmake ${CURRENT_PACKAGES_DIR}/share/gflags)
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/gflags-export-debug.cmake GFLAGS_DEBUG_MODULE)
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/gflags-targets-debug.cmake GFLAGS_DEBUG_MODULE)
|
||||
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}")
|
||||
string(REPLACE "/Lib/gflags.dll" "/bin/gflags.dll" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}")
|
||||
string(REPLACE "/Lib/gflags_nothreads.dll" "/bin/gflags_nothreads.dll" GFLAGS_DEBUG_MODULE "${GFLAGS_DEBUG_MODULE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-debug.cmake "${GFLAGS_DEBUG_MODULE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets-debug.cmake "${GFLAGS_DEBUG_MODULE}")
|
||||
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-release.cmake GFLAGS_RELEASE_MODULE)
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets-release.cmake GFLAGS_RELEASE_MODULE)
|
||||
string(REPLACE "/Lib/gflags.dll" "/bin/gflags.dll" GFLAGS_RELEASE_MODULE "${GFLAGS_RELEASE_MODULE}")
|
||||
string(REPLACE "/Lib/gflags_nothreads.dll" "/bin/gflags_nothreads.dll" GFLAGS_RELEASE_MODULE "${GFLAGS_RELEASE_MODULE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export-release.cmake "${GFLAGS_RELEASE_MODULE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets-release.cmake "${GFLAGS_RELEASE_MODULE}")
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake)
|
||||
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake GFLAGS_CONFIG_MODULE)
|
||||
file(READ ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake GFLAGS_CONFIG_MODULE)
|
||||
string(REPLACE "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
|
||||
"get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\nget_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
|
||||
GFLAGS_CONFIG_MODULE "${GFLAGS_CONFIG_MODULE}")
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-export.cmake ${GFLAGS_CONFIG_MODULE})
|
||||
file(WRITE ${CURRENT_PACKAGES_DIR}/share/gflags/gflags-targets.cmake ${GFLAGS_CONFIG_MODULE})
|
||||
|
||||
file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user