[nvtt]Upgrade version to 2.1.1 and fix build error on windows. (#6765)

* [nvtt]Upgrade version to 2.1.1 and fix build error on windows.

* [nvtt]Fix build error on OSX.

* [nvtt]Merge two patches.

* [nvtt]Re-trigger CI system.

* [nvtt]Fix build error on OSX.
This commit is contained in:
JackBoosY 2019-06-18 07:36:07 +08:00 committed by dan-shaw
parent 5e9ccbc4a5
commit 5bbba1c92b
4 changed files with 60 additions and 20 deletions

View File

@ -1,16 +1,16 @@
diff --git a/src/nvconfig.h.in b/src/nvconfig.h.in
index 16da646..ada6be0 100644
--- a/src/nvconfig.h.in
+++ b/src/nvconfig.h.in
@@ -1,7 +1,11 @@
#ifndef NV_CONFIG
#define NV_CONFIG
+#if NV_OS_DARWIN & !NV_OS_IOS
+#cmakedefine01 HAVE_UNISTD_H
+#else
#cmakedefine HAVE_UNISTD_H
+#endif
#cmakedefine HAVE_STDARG_H
#cmakedefine HAVE_SIGNAL_H
#cmakedefine HAVE_EXECINFO_H
diff --git a/src/nvconfig.h.in b/src/nvconfig.h.in
index 16da646..ada6be0 100644
--- a/src/nvconfig.h.in
+++ b/src/nvconfig.h.in
@@ -1,7 +1,11 @@
#ifndef NV_CONFIG
#define NV_CONFIG
+#if NV_OS_DARWIN & !NV_OS_IOS
+#cmakedefine01 HAVE_UNISTD_H
+#else
#cmakedefine HAVE_UNISTD_H
+#endif
#cmakedefine HAVE_STDARG_H
#cmakedefine HAVE_SIGNAL_H
#cmakedefine HAVE_EXECINFO_H

View File

@ -1,3 +1,3 @@
Source: nvtt
Version: 2.1.0-3
Version: 2.1.1
Description: Texture processing tools with support for Direct3D 10 and 11 formats.

View File

@ -0,0 +1,39 @@
diff --git a/extern/butteraugli/butteraugli.h b/extern/butteraugli/butteraugli.h
index 31824b8..c116a73 100644
--- a/extern/butteraugli/butteraugli.h
+++ b/extern/butteraugli/butteraugli.h
@@ -134,7 +134,14 @@ bool ButteraugliAdaptiveQuantization(size_t xsize, size_t ysize,
// The conventional syntax uint8_t* const RESTRICT is more confusing - it is
// not immediately obvious that the pointee is non-const.
template <typename T>
+#ifdef _MSC_VER
+// Due to MSVC bug:
+// https://developercommunity.visualstudio.com/content/problem/32196/msvc-cant-compile-a-templated-using-without-instan.html
+// , we cannot use __restrict now. Loss some performance instead of can't use this code.
+using ConstRestrict = T const;
+#else
using ConstRestrict = T const BUTTERAUGLI_RESTRICT;
+#endif
// Functions that depend on the cache line size.
class CacheAligned {
diff --git a/src/nvthread/Atomic.h b/src/nvthread/Atomic.h
index 212b9cb..b8eaedb 100644
--- a/src/nvthread/Atomic.h
+++ b/src/nvthread/Atomic.h
@@ -183,7 +183,6 @@ namespace nv {
#elif NV_CC_CLANG && (NV_OS_IOS || NV_OS_DARWIN)
- NV_COMPILER_CHECK(sizeof(uint32) == sizeof(long));
//ACS: Use Apple's atomics instead? I don't know if these are better in any way; there are non-barrier versions too. There's no OSAtomicSwap32 tho'
/*
@@ -254,7 +253,6 @@ namespace nv {
#elif NV_CC_CLANG && POSH_CPU_STRONGARM
- NV_COMPILER_CHECK(sizeof(uint32) == sizeof(long));
inline uint32 atomicIncrement(uint32 * value)
{

View File

@ -5,14 +5,15 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO castano/nvidia-texture-tools
REF 2.1.0
SHA512 6c5c9588af57023fc384de080cbe5c5ccd8707d04a9533384c606efd09730d780cb21bcf2d3576102a3facd2f281cacb2625958d74575e71550fd98da92e38b6
REF 2.1.1
SHA512 3e6fef5977ca29daa7dc97afe11d61de57a8556c9caf30902db8c5c167d9c38f736bcb62eebdaaf7558299b39975bc269d41ab980c813b67dd1fc85064c853c9
HEAD_REF master
PATCHES
001-define-value-for-HAVE_UNISTD_H-in-mac-os.patch
bc6h.patch
bc7.patch
squish.patch
fix-build-error.patch
)
vcpkg_configure_cmake(
@ -37,4 +38,4 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
# Handle copyright
file(REMOVE ${CURRENT_PACKAGES_DIR}/share/doc/nvtt/LICENSE)
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/nvtt)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/nvtt/LICENSE ${CURRENT_PACKAGES_DIR}/share/nvtt/copyright)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/nvtt/LICENSE ${CURRENT_PACKAGES_DIR}/share/nvtt/copyright)