Merge pull request #3559 from SuperWig/fmt-update

[fmt] update to 5.0.0
This commit is contained in:
Alexander Karatarakis 2018-05-29 14:22:39 -07:00 committed by GitHub
commit a3c14ae920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 13 deletions

View File

@ -1,4 +1,4 @@
Source: coolprop
Version: 6.1.0-3
Version: 6.1.0-4
Description: Thermophysical properties for the masses
Build-Depends: catch, eigen3, pybind11, if97, fmt, rapidjson, msgpack, refprop-headers

View File

@ -0,0 +1,39 @@
diff --git a/include/CPstrings.h b/include/CPstrings.h
index 2e5a5af..87f6b7c 100644
--- a/include/CPstrings.h
+++ b/include/CPstrings.h
@@ -5,6 +5,8 @@
#include <iterator>
#include <algorithm>
#include <functional>
+ #include <vector>
+ #include <string>
#if !defined(NO_CPPFORMAT)
#ifndef FMT_HEADER_ONLY
@@ -13,9 +15,6 @@
#include "fmt/format.h" // For addition of the string formatting functions and macros from cppformat
#include "fmt/printf.h" // For sprintf
#undef FMT_HEADER_ONLY
-#else
- #include <vector>
- #include <string>
#endif
#include "Exceptions.h"
@@ -57,11 +56,11 @@
// Missing string formatting function, this old guy is needed for ancient gcc compilers on PowerPC for VxWorks
inline std::string format(const char* fmt, ...);
#else
- // Missing std::string formatting function - provided by the cppformat library
- inline std::string format(const char *format, fmt::ArgList args) {
- return fmt::sprintf(format, args);
+ template<class...Args>
+ std::string format(const Args & ... args)
+ {
+ return fmt::sprintf(args...);
}
- FMT_VARIADIC(std::string, format, const char *)
#endif
// Missing string split - like in Python

View File

@ -7,6 +7,8 @@ vcpkg_from_github(
REF 0e934e842e9ce83eea64fda1d4ab8e59adf9d8cd
SHA512 a44eafc84f2b88259d7bcf6cfa81daeb81ea9d55bd356e59b3ef77b6f68ea405961c7cb54ba899e3896bb2a02d3e01119a4a51f72899126c8da6081fa2ece948
HEAD_REF master
PATCHES
${CMAKE_CURRENT_LIST_DIR}/fmt-fix.patch
)
vcpkg_find_acquire_program(PYTHON2)
@ -16,8 +18,8 @@ set(ENV{PATH} "$ENV{PATH};${PYTHON2_DIR}")
file(REMOVE_RECURSE ${SOURCE_PATH}/externals)
# Patch up the file locations
file(COPY
${CURRENT_INSTALLED_DIR}/include/catch.hpp
file(COPY
${CURRENT_INSTALLED_DIR}/include/catch.hpp
DESTINATION ${SOURCE_PATH}/externals/Catch/single_include
)
@ -30,12 +32,12 @@ file(COPY
DESTINATION ${SOURCE_PATH}/externals/Eigen/unsupported
)
file(COPY
file(COPY
${CURRENT_INSTALLED_DIR}/include/rapidjson
DESTINATION ${SOURCE_PATH}/externals/rapidjson/include
)
file(COPY
file(COPY
${CURRENT_INSTALLED_DIR}/include/IF97.h
DESTINATION ${SOURCE_PATH}/externals/IF97
)

View File

@ -1,3 +1,3 @@
Source: fmt
Version: 4.1.0
Version: 5.0.0
Description: Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams.

View File

@ -2,8 +2,8 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO fmtlib/fmt
REF 4.1.0
SHA512 8daaa4a61bfe63345a12df0a9bca0b1cd6a162d0f4e97d2d2978ae19a1a1357ec4d4cce948ce726cdbe9403e51ad995950a2a99de28f9b9085c02ce845540b22
REF 5.0.0
SHA512 1ce93648ab7aca6082767ff009d5836e226fa42f183852ca15230f371ef0a34878110ca63d8669a68de7f115c137fdaa11de998986a9440f08d50f0f214ebb90
HEAD_REF master
)
@ -22,19 +22,19 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/bin/fmt.dll)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmt.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmt.dll)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll)
# Force FMT_SHARED to 1
file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/format.h FMT_FORMAT_H)
string(REPLACE "defined(FMT_SHARED)" "1" FMT_FORMAT_H "${FMT_FORMAT_H}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/format.h "${FMT_FORMAT_H}")
file(READ ${CURRENT_PACKAGES_DIR}/include/fmt/core.h FMT_CORE_H)
string(REPLACE "defined(FMT_SHARED)" "1" FMT_CORE_H "${FMT_CORE_H}")
file(WRITE ${CURRENT_PACKAGES_DIR}/include/fmt/core.h "${FMT_CORE_H}")
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_fixup_cmake_targets()
file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake FMT_DEBUG_MODULE)
string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE})
string(REPLACE "lib/fmtd.dll" "bin/fmtd.dll" FMT_DEBUG_MODULE ${FMT_DEBUG_MODULE})
file(WRITE ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake "${FMT_DEBUG_MODULE}")
file(READ ${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake FMT_RELEASE_MODULE)
string(REPLACE "lib/fmt.dll" "bin/fmt.dll" FMT_RELEASE_MODULE ${FMT_RELEASE_MODULE})