[date] Update to official release version 3.0.3. (#42864)

This commit is contained in:
JoergAtGithub 2024-12-30 16:30:53 +01:00 committed by GitHub
parent b6b5322b16
commit eac02d61d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 161 deletions

View File

@ -1,90 +0,0 @@
diff --git a/include/date/date.h b/include/date/date.h
index beb627e..ba48515 100644
--- a/include/date/date.h
+++ b/include/date/date.h
@@ -81,7 +81,7 @@
#ifdef _MSC_VER
# pragma warning(push)
// warning C4127: conditional expression is constant
-# pragma warning(disable : 4127)
+# pragma warning(disable : 4127 4996)
#endif
namespace date
diff --git a/src/tz.cpp b/src/tz.cpp
index 82e4312..9481afa 100644
--- a/src/tz.cpp
+++ b/src/tz.cpp
@@ -202,35 +202,6 @@ namespace
using co_task_mem_ptr = std::unique_ptr<wchar_t[], task_mem_deleter>;
}
-static
-std::wstring
-convert_utf8_to_utf16(const std::string& s)
-{
- std::wstring out;
- const int size = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, NULL, 0);
-
- if (size == 0)
- {
- std::string msg = "Failed to determine required size when converting \"";
- msg += s;
- msg += "\" to UTF-16.";
- throw std::runtime_error(msg);
- }
-
- out.resize(size);
- const int check = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, &out[0], size);
-
- if (size != check)
- {
- std::string msg = "Failed to convert \"";
- msg += s;
- msg += "\" to UTF-16.";
- throw std::runtime_error(msg);
- }
-
- return out;
-}
-
// We might need to know certain locations even if not using the remote API,
// so keep these routines out of that block for now.
static
@@ -268,6 +239,36 @@ get_download_folder()
# endif // !INSTALL
# endif // WINRT
+
+static
+std::wstring
+convert_utf8_to_utf16(const std::string& s)
+{
+ std::wstring out;
+ const int size = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, NULL, 0);
+
+ if (size == 0)
+ {
+ std::string msg = "Failed to determine required size when converting \"";
+ msg += s;
+ msg += "\" to UTF-16.";
+ throw std::runtime_error(msg);
+ }
+
+ out.resize(size);
+ const int check = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, &out[0], size);
+
+ if (size != check)
+ {
+ std::string msg = "Failed to convert \"";
+ msg += s;
+ msg += "\" to UTF-16.";
+ throw std::runtime_error(msg);
+ }
+
+ return out;
+}
+
# else // !_WIN32
# if !defined(INSTALL)

View File

@ -1,63 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 012512a..2cbcc21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,10 +73,6 @@ target_sources( date INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/iso_week.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/date/julian.h>
)
-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
- # public headers will get installed:
- set_target_properties( date PROPERTIES PUBLIC_HEADER include/date/date.h )
-endif ()
# These used to be set with generator expressions,
#
@@ -144,7 +140,6 @@ if( BUILD_TZ_LIB )
endif( )
set_target_properties( date-tz PROPERTIES
POSITION_INDEPENDENT_CODE ON
- PUBLIC_HEADER "${TZ_HEADERS}"
VERSION "${PROJECT_VERSION}"
SOVERSION "${ABI_VERSION}" )
if( NOT MSVC )
@@ -169,30 +164,26 @@ write_basic_package_version_file( "${version_config}"
COMPATIBILITY SameMajorVersion )
install( TARGETS date
- EXPORT dateConfig
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
+ EXPORT dateConfig )
export( TARGETS date NAMESPACE date:: FILE dateTargets.cmake )
-if (CMAKE_VERSION VERSION_LESS 3.15)
- install(
- FILES include/date/date.h
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date )
-endif ()
+install(
+ DIRECTORY "${CMAKE_SOURCE_DIR}/include/date"
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+ PATTERN "chrono_io.h" EXCLUDE
+)
if( BUILD_TZ_LIB )
install( TARGETS date-tz
EXPORT dateConfig
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/date
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) # This is for Windows
export( TARGETS date-tz NAMESPACE date:: APPEND FILE dateTargets.cmake )
endif( )
-if( WIN32 AND NOT CYGWIN)
- set( CONFIG_LOC CMake )
-else( )
- set( CONFIG_LOC "${CMAKE_INSTALL_LIBDIR}/cmake/date" )
-endif( )
+
+set( CONFIG_LOC "${CMAKE_INSTALL_LIBDIR}/cmake/date" )
+
install( EXPORT dateConfig
FILE dateTargets.cmake
NAMESPACE date::

View File

@ -8,12 +8,9 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO HowardHinnant/date
REF 1ead6715dec030d340a316c927c877a3c4e5a00c
SHA512 a0b5dd2d94788929a2ba98bd629d64d188ff0ae40affd9338d3d7a94c848ae4d6addc72613964e7fad7f62e4ee20b7170b2133cb39d4e018c604ba35c68d1cff
REF "v${VERSION}"
SHA512 e11d7f230ecc431d94c4b58fe7394dd57a9ec0baa9de52496578479b51bbf885566d6666882916d84d388060fa36065b3fa8dd3a8bc14f720b38d1c943f06700
HEAD_REF master
PATCHES
0001-fix-uwp.patch
0002-fix-cmake-install.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
@ -29,7 +26,12 @@ vcpkg_cmake_configure(
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/date)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_cmake_config_fixup(CONFIG_PATH CMake)
else()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/date")
endif()
vcpkg_copy_pdbs()

View File

@ -1,6 +1,6 @@
{
"name": "date",
"version-date": "2024-05-14",
"version": "3.0.3",
"description": "A date and time library based on the C++17 <chrono> header",
"homepage": "https://github.com/HowardHinnant/date",
"license": "MIT",

View File

@ -2213,7 +2213,7 @@
"port-version": 0
},
"date": {
"baseline": "2024-05-14",
"baseline": "3.0.3",
"port-version": 0
},
"datraw": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3655f01c9296e57b7d2ab47028498db6d88f7f49",
"version": "3.0.3",
"port-version": 0
},
{
"git-tree": "52f7b2f3a6398c0aa4a073a06c55c1a513b478bb",
"version-date": "2024-05-14",