diff options
| author | NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> | 2020-10-24 08:31:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-23 17:31:00 -0700 |
| commit | a97e32fa2de760252ec401f21d82d0cd3dd402c1 (patch) | |
| tree | 51e9f99d4f61bc3468b1870b2cf168289263b279 /ports/nvtt | |
| parent | a3ed6c63900a5ff2f5622971682aa0a89873aa68 (diff) | |
| download | vcpkg-a97e32fa2de760252ec401f21d82d0cd3dd402c1.tar.gz vcpkg-a97e32fa2de760252ec401f21d82d0cd3dd402c1.zip | |
[netcdf-c/nvtt] Update to the latest version (#13674)
Diffstat (limited to 'ports/nvtt')
| -rw-r--r-- | ports/nvtt/CONTROL | 4 | ||||
| -rw-r--r-- | ports/nvtt/add-compile-options-for-osx.patch | 15 | ||||
| -rw-r--r-- | ports/nvtt/bc6h.patch | 13 | ||||
| -rw-r--r-- | ports/nvtt/bc7.patch | 12 | ||||
| -rw-r--r-- | ports/nvtt/fix-build-error.patch | 76 | ||||
| -rw-r--r-- | ports/nvtt/portfile.cmake | 10 | ||||
| -rw-r--r-- | ports/nvtt/squish.patch | 13 |
7 files changed, 84 insertions, 59 deletions
diff --git a/ports/nvtt/CONTROL b/ports/nvtt/CONTROL index 189ff6caf..aaa388269 100644 --- a/ports/nvtt/CONTROL +++ b/ports/nvtt/CONTROL @@ -1,3 +1,5 @@ Source: nvtt
-Version: 2.1.1
+Version: 2.1.2
+Homepage: https://github.com/castano/nvidia-texture-tools
Description: Texture processing tools with support for Direct3D 10 and 11 formats.
+Supports: !x86
diff --git a/ports/nvtt/add-compile-options-for-osx.patch b/ports/nvtt/add-compile-options-for-osx.patch new file mode 100644 index 000000000..6b7d94559 --- /dev/null +++ b/ports/nvtt/add-compile-options-for-osx.patch @@ -0,0 +1,15 @@ +diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt
+index 9688c9c..42942c0 100644
+--- a/src/nvtt/CMakeLists.txt
++++ b/src/nvtt/CMakeLists.txt
+@@ -47,6 +47,10 @@ ADD_DEFINITIONS(-DNVTT_EXPORTS)
+ #ADD_DEFINITIONS(-DHAVE_RGETC)
+ #ADD_DEFINITIONS(-DHAVE_ETCPACK)
+
++if(APPLE)
++ add_compile_options(-mbmi2 -mfma)
++endif()
++
+ IF(NVTT_SHARED)
+ ADD_LIBRARY(nvtt SHARED ${NVTT_SRCS})
+ ELSE(NVTT_SHARED)
diff --git a/ports/nvtt/bc6h.patch b/ports/nvtt/bc6h.patch index 3e68ff516..8d3339eb2 100644 --- a/ports/nvtt/bc6h.patch +++ b/ports/nvtt/bc6h.patch @@ -1,14 +1,13 @@ diff --git a/src/bc6h/CMakeLists.txt b/src/bc6h/CMakeLists.txt -index 635e0f3a..f758df43 100644 ---- a/src/bc6h/CMakeLists.txt +index fd75e74..b392d90 100644 +--- a/src/bc6h/CMakeLists.txt +++ b/src/bc6h/CMakeLists.txt -@@ -20,3 +20,8 @@ IF(NOT WIN32) - SET_TARGET_PROPERTIES(bc6h PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - ENDIF(NOT WIN32) +@@ -15,3 +15,8 @@ SET(BC6H_SRCS + + ADD_LIBRARY(bc6h STATIC ${BC6H_SRCS}) + TARGET_LINK_LIBRARIES(bc6h nvcore nvmath) + +INSTALL(TARGETS bc6h + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) -\ No newline at end of file diff --git a/ports/nvtt/bc7.patch b/ports/nvtt/bc7.patch index c94fcef23..5c644fece 100644 --- a/ports/nvtt/bc7.patch +++ b/ports/nvtt/bc7.patch @@ -1,11 +1,11 @@ diff --git a/src/bc7/CMakeLists.txt b/src/bc7/CMakeLists.txt -index 2eb01c06..0c36895b 100644 ---- a/src/bc7/CMakeLists.txt +index 566fe1f..d0d4e8a 100644 +--- a/src/bc7/CMakeLists.txt +++ b/src/bc7/CMakeLists.txt -@@ -28,3 +28,8 @@ IF(NOT WIN32) - SET_TARGET_PROPERTIES(bc7 PROPERTIES COMPILE_FLAGS -fPIC) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - ENDIF(NOT WIN32) +@@ -23,3 +23,8 @@ SET(BC7_SRCS + + ADD_LIBRARY(bc7 STATIC ${BC7_SRCS}) + TARGET_LINK_LIBRARIES(bc7 nvcore nvmath) + +INSTALL(TARGETS bc7 + RUNTIME DESTINATION bin diff --git a/ports/nvtt/fix-build-error.patch b/ports/nvtt/fix-build-error.patch index 7ba1c1976..5274efa31 100644 --- a/ports/nvtt/fix-build-error.patch +++ b/ports/nvtt/fix-build-error.patch @@ -1,39 +1,47 @@ -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 +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 668cd7e..72d6e61 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,9 +7,17 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}") - // 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 { + # Compiler check (needs -std:c++11 flag) + include(CheckCXXCompilerFlag) ++if(MSVC) ++CHECK_CXX_COMPILER_FLAG("/std:c++14" COMPILER_SUPPORTS_CXX14) ++else() + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +-if(COMPILER_SUPPORTS_CXX11) ++endif() ++if(COMPILER_SUPPORTS_CXX11 OR COMPILER_SUPPORTS_CXX14) ++ if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_STANDARD 11) ++ else() ++ set(CMAKE_CXX_STANDARD 14) ++ endif() + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + else() +diff --git a/extern/CMP_Core/source/cmp_math_func.h b/extern/CMP_Core/source/cmp_math_func.h +index c2f8908..b652497 100644 +--- a/extern/CMP_Core/source/cmp_math_func.h ++++ b/extern/CMP_Core/source/cmp_math_func.h +@@ -32,6 +32,7 @@ + // Core API which have have GPU equivalents, defined here for HPC_CPU usage + //============================================================================ ++#include <cmath> + #include <algorithm> + using namespace std; - #elif NV_CC_CLANG && (NV_OS_IOS || NV_OS_DARWIN) -- NV_COMPILER_CHECK(sizeof(uint32) == sizeof(long)); +diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt +index 8285f99..9688c9c 100644 +--- a/src/nvtt/CMakeLists.txt ++++ b/src/nvtt/CMakeLists.txt +@@ -63,5 +63,5 @@ INSTALL(TARGETS nvtt + INSTALL(FILES nvtt.h nvtt_wrapper.h DESTINATION include/nvtt) - //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) - { +-ADD_SUBDIRECTORY(tools) +-ADD_SUBDIRECTORY(tests) ++#ADD_SUBDIRECTORY(tools) ++#ADD_SUBDIRECTORY(tests) diff --git a/ports/nvtt/portfile.cmake b/ports/nvtt/portfile.cmake index bacdebbbc..46ea7f9b8 100644 --- a/ports/nvtt/portfile.cmake +++ b/ports/nvtt/portfile.cmake @@ -1,12 +1,12 @@ -include(vcpkg_common_functions)
+vcpkg_fail_port_install(ON_ARCH "x86")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO castano/nvidia-texture-tools
- REF 2.1.1
- SHA512 3e6fef5977ca29daa7dc97afe11d61de57a8556c9caf30902db8c5c167d9c38f736bcb62eebdaaf7558299b39975bc269d41ab980c813b67dd1fc85064c853c9
+ REF b1a90f36013522b9e5a3a2197859b72188752e3f # 2.1.2
+ SHA512 13cf04a9856f150f7569c8c256c42fc6a5bc40586c9ca2b3ae553edf5bfcbccbba5b8538924079ed35effdd07b9e3ef4bfdb9733a2ec51f5a95f958885cc6cca
HEAD_REF master
PATCHES
001-define-value-for-HAVE_UNISTD_H-in-mac-os.patch
@@ -14,6 +14,7 @@ vcpkg_from_github( bc7.patch
squish.patch
fix-build-error.patch
+ add-compile-options-for-osx.patch
)
vcpkg_configure_cmake(
@@ -37,5 +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)
\ No newline at end of file +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
\ No newline at end of file diff --git a/ports/nvtt/squish.patch b/ports/nvtt/squish.patch index 36ce7be76..5f971a762 100644 --- a/ports/nvtt/squish.patch +++ b/ports/nvtt/squish.patch @@ -1,12 +1,13 @@ diff --git a/src/nvtt/squish/CMakeLists.txt b/src/nvtt/squish/CMakeLists.txt -index 832013e1..76824137 100644 ---- a/src/nvtt/squish/CMakeLists.txt +index 65a5dd3..d093ce5 100644 +--- a/src/nvtt/squish/CMakeLists.txt +++ b/src/nvtt/squish/CMakeLists.txt -@@ -33,3 +33,7 @@ IF(NOT WIN32) - ENDIF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) - ENDIF(NOT WIN32) +@@ -21,3 +21,8 @@ SET(SQUISH_SRCS + simd_ve.h) -+INSTALL(TARGETS squish + ADD_LIBRARY(nvsquish STATIC ${SQUISH_SRCS}) ++ ++INSTALL(TARGETS nvsquish + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib/static) |
