Skip to content

Commit

Permalink
[draco, flatbuffers, forge] Update to new version (#6796)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyWangL authored and Rastaban committed Jun 7, 2019
1 parent b9cf338 commit 5ef8bb9
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 210 deletions.
2 changes: 1 addition & 1 deletion ports/draco/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: draco
Version: 1.3.3-2
Version: 1.3.5
Description: A library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
Build-Depends:
45 changes: 15 additions & 30 deletions ports/draco/fix-compile-error-uwp.patch
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
diff --git a/src/draco/core/symbol_coding_utils.h b/src/draco/core/symbol_coding_utils.h
index be2183d..eaaca00 100644
--- a/src/draco/core/symbol_coding_utils.h
+++ b/src/draco/core/symbol_coding_utils.h
@@ -41,7 +41,9 @@ typename std::make_unsigned<IntTypeT>::type ConvertSignedIntToSymbol(
if (val >= 0) {
return static_cast<UnsignedType>(val) << 1;
}
- val = -(val + 1); // Map -1 to 0, -2 to -1, etc..
+ // Map -1 to 0, -2 to -1, etc..
+ val += 1;
+ val *= -1;
UnsignedType ret = static_cast<UnsignedType>(val);
ret <<= 1;
ret |= 1;
diff --git a/src/draco/io/parser_utils.cc b/src/draco/io/parser_utils.cc
index 1aa52cc..cfbbdbd 100644
--- a/src/draco/io/parser_utils.cc
+++ b/src/draco/io/parser_utils.cc
@@ -150,7 +150,9 @@ bool ParseSignedInt(DecoderBuffer *buffer, int32_t *value) {
uint32_t v;
if (!ParseUnsignedInt(buffer, &v))
return false;
- *value = (sign < 0) ? -v : v;
+ if (sign < 0)
+ v *= -1;
+ *value = v;
return true;
}

diff --git a/src/draco/io/parser_utils.cc b/src/draco/io/parser_utils.cc
index 0a22ba1..9862949 100644
--- a/src/draco/io/parser_utils.cc
+++ b/src/draco/io/parser_utils.cc
@@ -150,7 +150,9 @@ bool ParseSignedInt(DecoderBuffer *buffer, int32_t *value) {
uint32_t v;
if (!ParseUnsignedInt(buffer, &v))
return false;
- *value = (sign < 0) ? -v : v;
+ if (sign < 0)
+ v *= -1;
+ *value = v;
return true;
}

13 changes: 13 additions & 0 deletions ports/draco/fix-uwperror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/draco/core/bit_utils.h b/src/draco/core/bit_utils.h
index f63cd07..0f6baaf 100644
--- a/src/draco/core/bit_utils.h
+++ b/src/draco/core/bit_utils.h
@@ -26,6 +26,8 @@
#include <intrin.h>
#endif // defined(_MSC_VER)

+#pragma warning(disable:4146)
+
namespace draco {

// Returns the number of '1' bits within the input 32 bit integer.
5 changes: 3 additions & 2 deletions ports/draco/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/draco
REF 1.3.3
SHA512 80ed5a623046822f5bb26b2454c8ee8cc93ffe9eb3012e8461cefdfc577b26d69a92ea0f0c5e14f5f48c1ef99f9a7263b01710df376792e74358ae14e49c3897
REF 1.3.5
SHA512 f99fcbec60fbd1683d8aacc35ff8ad9ee1c84374132ad4cc8c0f56662f5d33f940f89028cf3e577cde3314fd0766c124f61798121e4127e888f302e9efe1a004
HEAD_REF master
PATCHES
fix-compile-error-uwp.patch
fix-uwperror.patch
)

vcpkg_configure_cmake(
Expand Down
2 changes: 1 addition & 1 deletion ports/flatbuffers/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: flatbuffers
Version: 1.10.0-1
Version: 1.11.0
Description: Memory Efficient Serialization Library http://google.github.io/flatbuffers/
FlatBuffers is an efficient cross platform serialization library for games and other memory constrained apps. It allows you to directly access serialized data without unpacking/parsing it first, while still having great forwards/backwards compatibility.
20 changes: 20 additions & 0 deletions ports/flatbuffers/fix-uwp-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/util.cpp b/src/util.cpp
index c1bb197..658e116 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -239,9 +239,15 @@ bool ReadEnvironmentVariable(const char *var_name, std::string *_value) {
#ifdef _MSC_VER
__pragma(warning(disable : 4996)); // _CRT_SECURE_NO_WARNINGS
#endif
+#if _WIN32_WINNT < 0x0A00
auto env_str = std::getenv(var_name);
if (!env_str) return false;
if (_value) *_value = std::string(env_str);
+#else
+ //There is no support for environment variables in UWP
+ var_name; // Do nothing
+ *_value = std::string("");
+#endif
return true;
}

6 changes: 3 additions & 3 deletions ports/flatbuffers/ignore_use_of_cmake_toolchain_file.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3388dd..699ea3b 100644
index 119855a..945085a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,7 +104,7 @@ set(FlatBuffers_GRPCTest_SRCS
@@ -155,7 +155,7 @@ set(FlatBuffers_GRPCTest_SRCS
# source_group(Compiler FILES ${FlatBuffers_Compiler_SRCS})
# source_group(Tests FILES ${FlatBuffers_Tests_SRCS})

-if(EXISTS "${CMAKE_TOOLCHAIN_FILE}")
+if(EXISTS "${CMAKE_TOOLCHAIN_FILE}" AND NOT DEFINED VCPKG_TOOLCHAIN)
# do not apply any global settings if the toolchain
# is being configured externally
elseif(APPLE)
message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}.")
10 changes: 5 additions & 5 deletions ports/flatbuffers/no-werror.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a3388dd..f0626e5 100644
index 119855a..6269362 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,12 +119,16 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
@@ -172,13 +172,17 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
"${CMAKE_CXX_FLAGS} -std=c++0x")
endif(CYGWIN)
set(CMAKE_CXX_FLAGS
- "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -Werror=shadow")
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Werror=shadow")
+ "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -Werror=shadow")
set(FLATBUFFERS_PRIVATE_CXX_FLAGS "-Wold-style-cast")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.4)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -faligned-new")
"${CMAKE_CXX_FLAGS} -faligned-new -Werror=implicit-fallthrough=2")
endif()
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
+ set(CMAKE_CXX_FLAGS
Expand All @@ -20,4 +21,3 @@ index a3388dd..f0626e5 100644
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wunused-result -Werror=unused-result -Wunused-parameter -Werror=unused-parameter")
endif()

9 changes: 5 additions & 4 deletions ports/flatbuffers/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/flatbuffers
REF v1.10.0
SHA512 b8382c8e9a45d6aca83270e93704b9ef2938e4ef9bb5165edbd8f286329e86353037ad6e54a99fd3d70b0c893d06cfd8766e00f05497e69be4b9e6c0506133d2
REF v1.11.0
SHA512 cbb2e1e6885255cc950e2fa8248b56a8bc2c6e52f6fc7ed9066e6ae5a1d53f1263594b83f4b944a672cf9d0e1e800e51ce7fa423eff45abf5056269879c286fe
HEAD_REF master
PATCHES
${CMAKE_CURRENT_LIST_DIR}/ignore_use_of_cmake_toolchain_file.patch
${CMAKE_CURRENT_LIST_DIR}/no-werror.patch
ignore_use_of_cmake_toolchain_file.patch
no-werror.patch
fix-uwp-build.patch
)

set(OPTIONS)
Expand Down
2 changes: 1 addition & 1 deletion ports/forge/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: forge
Version: 1.0.3-1
Version: 1.0.4-1
Description: Helps with high performance visualizations involving OpenGL-CUDA/OpenCL interop.
Build-Depends: glfw3, glm, glbinding, freetype, boost-functional, freeimage, fontconfig (!windows)
28 changes: 28 additions & 0 deletions ports/forge/fix-static_build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/extern/glad/CMakeLists.txt b/extern/glad/CMakeLists.txt
index c8c8d86..27adf86 100644
--- a/extern/glad/CMakeLists.txt
+++ b/extern/glad/CMakeLists.txt
@@ -2,15 +2,19 @@ add_library(forge_glad_interface INTERFACE)

target_include_directories(forge_glad_interface
INTERFACE
- ${CMAKE_CURRENT_SOURCE_DIR}/include
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)

target_sources(forge_glad_interface
INTERFACE
- ${CMAKE_CURRENT_SOURCE_DIR}/src/glad.c
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/glad.c>
)

target_link_libraries(forge_glad_interface
INTERFACE
- ${CMAKE_DL_LIBS}
+ $<BUILD_INTERFACE:${CMAKE_DL_LIBS}>
)
+
+if (NOT BUILD_SHARED_LIBS)
+ install(TARGETS forge_glad_interface EXPORT ForgeTargets)
+endif ()
\ No newline at end of file
115 changes: 0 additions & 115 deletions ports/forge/forge_targets_fix.patch

This file was deleted.

13 changes: 4 additions & 9 deletions ports/forge/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
message(FATAL_ERROR "This port currently only supports x64 architecture")
endif()

set(PATCHES forge_targets_fix.patch)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
list(APPEND PATCHES static_build.patch)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO arrayfire/forge
REF v1.0.3
SHA512 e1a7688c1c3ab4659401463c5d025917b6e5766129446aefbebe0d580756cd2cc07256ddda9b20899690765220e5467b9209e00476c80ea6a51a1a0c0e9da616
REF 650bf611de102a2cc0c32dba7646f8128f0300c8
SHA512 2093464db0f3a7f0178f65bed37986a4df1117f1d7ad65157d525584490cdf234475f01ed1a2003a9e54bdc3b9e2e450808044a264c2284d67b8c2a353400027
HEAD_REF master
PATCHES ${PATCHES}
PATCHES fix-static_build.patch
)

vcpkg_configure_cmake(
Expand All @@ -41,4 +36,4 @@ file(REMOVE_RECURSE
${DLLS}
)

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/forge RENAME copyright)
file(INSTALL ${SOURCE_PATH}/.github/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/forge RENAME copyright)
39 changes: 0 additions & 39 deletions ports/forge/static_build.patch

This file was deleted.

0 comments on commit 5ef8bb9

Please sign in to comment.