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/fix-build-error.patch | |
| 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/fix-build-error.patch')
| -rw-r--r-- | ports/nvtt/fix-build-error.patch | 76 |
1 files changed, 42 insertions, 34 deletions
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) |
