[draco, flatbuffers, forge] Update to new version (#6796)

This commit is contained in:
wangli28 2019-06-07 02:03:08 +00:00 committed by Phil Christensen
parent b9cf3384c3
commit 5ef8bb9abc
14 changed files with 99 additions and 210 deletions

View File

@ -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:

View File

@ -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;
}

View File

@ -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.

View File

@ -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(

View File

@ -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.

View File

@ -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;
}

View File

@ -1,8 +1,8 @@
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})
@ -10,4 +10,4 @@ index a3388dd..699ea3b 100644
+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}.")

View File

@ -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
@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -1,115 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7236a6..b4b910a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,64 +110,63 @@ install(DIRECTORY include/
PATTERN "*.h"
PATTERN "*.hpp"
PATTERN ".gitignore" EXCLUDE)
-# The Forge version header is generated and thus need to be
-# included explicitly
+
install(FILES ${Forge_BINARY_DIR}/include/fg/version.h
DESTINATION "${FG_INSTALL_INC_DIR}/fg/"
COMPONENT headers)
-install(EXPORT ForgeTargets
- NAMESPACE Forge::
- DESTINATION ${FG_INSTALL_CMAKE_DIR}
- COMPONENT forge)
-
-export(EXPORT ForgeTargets
- NAMESPACE Forge::
- FILE cmake/ForgeTargets.cmake)
+# install the examples irrespective of the FG_BUILD_EXAMPLES value
+# only the examples source files are installed, so the installation of these
+# source files does not depend on FG_BUILD_EXAMPLES
+# when FG_BUILD_EXAMPLES is OFF, the examples source is installed without
+# building the example executables
+install(DIRECTORY examples/ #NOTE The slash at the end is important
+ DESTINATION ${FG_INSTALL_EXAMPLE_DIR}
+ COMPONENT examples)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
- "${Forge_BINARY_DIR}/cmake/ForgeConfigVersion.cmake"
+ "${Forge_BINARY_DIR}/ForgeConfigVersion.cmake"
COMPATIBILITY SameMajorVersion)
-# This config file will be installed so we need to set the install_destination
-# path relative to the install path
+
+# export install config file
set(INCLUDE_DIRS include)
set(CMAKE_DIR ${FG_INSTALL_CMAKE_DIR})
configure_package_config_file(
- "${PROJECT_SOURCE_DIR}/CMakeModules/ForgeConfig.cmake.in"
- "cmake/install/ForgeConfig.cmake"
- INSTALL_DESTINATION "${FG_INSTALL_CMAKE_DIR}"
- PATH_VARS INCLUDE_DIRS CMAKE_DIR)
-
-install(FILES ${Forge_BINARY_DIR}/cmake/install/ForgeConfig.cmake
- ${Forge_BINARY_DIR}/cmake/ForgeConfigVersion.cmake
+ "${PROJECT_SOURCE_DIR}/CMakeModules/ForgeConfig.cmake.in"
+ "cmake_install/ForgeConfig.cmake"
+ INSTALL_DESTINATION "${FG_INSTALL_CMAKE_DIR}"
+ PATH_VARS INCLUDE_DIRS CMAKE_DIR
+)
+install(FILES ${Forge_BINARY_DIR}/cmake_install/ForgeConfig.cmake
+ ${Forge_BINARY_DIR}/ForgeConfigVersion.cmake
DESTINATION ${FG_INSTALL_CMAKE_DIR}
- COMPONENT cmake)
+ COMPONENT cmake
+)
+install(EXPORT ForgeTargets
+ NAMESPACE Forge::
+ DESTINATION ${FG_INSTALL_CMAKE_DIR}
+ COMPONENT forge
+)
-# Following file will be used to create the config file for the build directory.
-# These config files will be used by the examples to find the Forge
-# libraries
+
+# export build tree targets config file
set(INCLUDE_DIRS "${Forge_SOURCE_DIR}/include" "${Forge_BINARY_DIR}/include")
-set(CMAKE_DIR "${Forge_BINARY_DIR}/cmake")
+set(CMAKE_DIR "${Forge_BINARY_DIR}")
configure_package_config_file(
- "${PROJECT_SOURCE_DIR}/CMakeModules/ForgeConfig.cmake.in"
- "cmake/ForgeConfig.cmake"
- INSTALL_DESTINATION "${Forge_BINARY_DIR}/cmake"
- PATH_VARS INCLUDE_DIRS CMAKE_DIR
- INSTALL_PREFIX "${Forge_BINARY_DIR}")
+ "${PROJECT_SOURCE_DIR}/CMakeModules/ForgeConfig.cmake.in"
+ "ForgeConfig.cmake"
+ INSTALL_DESTINATION "${Forge_BINARY_DIR}"
+ PATH_VARS INCLUDE_DIRS CMAKE_DIR
+ INSTALL_PREFIX "${Forge_BINARY_DIR}"
+)
+export(EXPORT ForgeTargets
+ NAMESPACE Forge::
+ FILE ForgeTargets.cmake
+)
+#export(PACKAGE Forge)
-#--------------------------------------------------------------------
-# Install examples
-#--------------------------------------------------------------------
-# install the examples irrespective of the FG_BUILD_EXAMPLES value
-# only the examples source files are installed, so the installation of these
-# source files does not depend on FG_BUILD_EXAMPLES
-# when FG_BUILD_EXAMPLES is OFF, the examples source is installed without
-# building the example executables
-install(DIRECTORY examples/ #NOTE The slash at the end is important
- DESTINATION ${FG_INSTALL_EXAMPLE_DIR}
- COMPONENT examples)
include(CPackConfig)
@@ -177,4 +176,4 @@ conditional_directory(FG_BUILD_EXAMPLES examples)
mark_as_advanced(
pkgcfg_lib_FontConfigPkg_freetype
pkgcfg_lib_FontConfigPkg_fontconfig
- )
+)

View File

@ -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(
@ -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)

View File

@ -1,39 +0,0 @@
diff --git a/src/backend/opengl/CMakeLists.txt b/src/backend/opengl/CMakeLists.txt
index 1aeec1e..52eff05 100755
--- a/src/backend/opengl/CMakeLists.txt
+++ b/src/backend/opengl/CMakeLists.txt
@@ -142,7 +142,7 @@ install(TARGETS forge
INCLUDES DESTINATION ${FG_INSTALL_INC_DIR})
# install dependencies
-if (WIN32)
+if (WIN32 AND BUILD_SHARED_LIBS)
if (FG_WITH_FREEIMAGE AND NOT FG_USE_STATIC_FREEIMAGE)
install(FILES $<TARGET_FILE:FreeImage::FreeImage>
DESTINATION ${FG_INSTALL_BIN_DIR}
diff --git a/src/backend/opengl/glfw/CMakeLists.txt b/src/backend/opengl/glfw/CMakeLists.txt
index caf4913..3c8d71c 100644
--- a/src/backend/opengl/glfw/CMakeLists.txt
+++ b/src/backend/opengl/glfw/CMakeLists.txt
@@ -24,7 +24,7 @@ if (NOT BUILD_SHARED_LIBS)
install(TARGETS forge_wtk_interface EXPORT ForgeTargets)
endif ()
-if (WIN32)
+if (WIN32 AND BUILD_SHARED_LIBS)
install(FILES $<TARGET_FILE:glfw>
DESTINATION ${FG_INSTALL_BIN_DIR}
COMPONENT dependencies)
diff --git a/src/backend/opengl/sdl/CMakeLists.txt b/src/backend/opengl/sdl/CMakeLists.txt
index d8cd312..d55f27d 100644
--- a/src/backend/opengl/sdl/CMakeLists.txt
+++ b/src/backend/opengl/sdl/CMakeLists.txt
@@ -24,7 +24,7 @@ if (NOT BUILD_SHARED_LIBS)
install(TARGETS forge_wtk_interface EXPORT ForgeTargets)
endif ()
-if (WIN32)
+if (WIN32 AND BUILD_SHARED_LIBS)
install(FILES $<TARGET_FILE:SDL2::SDL2>
DESTINATION ${FG_INSTALL_BIN_DIR}
COMPONENT dependencies)