Add Compiler option -D_DISABLE_EXTENDED_ALIGNED to disable error C2338

This commit is contained in:
Larry-Hu 2018-06-12 01:34:07 -07:00
parent 80f64c24dc
commit 9d0c7ca02e
7 changed files with 38 additions and 33 deletions

View File

@ -1,4 +1,4 @@
Source: cartographer
Version: 0.3.0-4
Version: 0.3.0-5
Build-Depends: ceres[eigensparse], gflags, glog, lua, cairo, boost-iostreams, gtest, protobuf
Description: Google 2D & 3D SLAM package

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc92e9b..4c1826a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,7 +226,7 @@ target_include_directories(${PROJECT_NAME} SYSTEM PRIVATE
"${GMOCK_INCLUDE_DIRS}")
target_link_libraries(${PROJECT_NAME} PUBLIC ${GMOCK_LIBRARY})
-set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
+set(TARGET_COMPILE_FLAGS "-D_DISABLE_EXTENDED_ALIGNED_STORAGE ${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS ${TARGET_COMPILE_FLAGS})

View File

@ -6,12 +6,9 @@ vcpkg_from_github(
REF a7ed7e224f98b396762c865b81b62dc3abea2e81
SHA512 2ab167c1c314591b4916baf70b8ad92ae542986c3578319d2454c904adae10f8027bc696579d6e2864d3606a6711563b82438e847527cad4ab0c2bd603a63eb7
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
PATCHES
${CMAKE_CURRENT_LIST_DIR}/fix-find-packages.patch
${CMAKE_CURRENT_LIST_DIR}/disable-C2338-cartographer.patch
)
vcpkg_configure_cmake(

View File

@ -1,4 +1,4 @@
Source: mongo-cxx-driver
Version: 3.1.1-2
Version: 3.1.1-3
Build-Depends: libbson, mongo-c-driver, boost-smart-ptr, boost-optional, boost-utility
Description: MongoDB C++ Driver.

View File

@ -0,0 +1,11 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a019eb1..8ab0f71 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,5 +14,6 @@
add_definitions(-DMONGO_CXX_DRIVER_COMPILING)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
+add_definitions(-D_DISABLE_EXTENDED_ALIGNED_STORAGE)
add_subdirectory(bsoncxx)
add_subdirectory(mongocxx)

View File

@ -1,19 +1,15 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mongo-cxx-driver-r3.1.1)
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/mongodb/mongo-cxx-driver/archive/r3.1.1.tar.gz"
FILENAME "mongo-cxx-driver-r3.1.1.tar.gz"
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mongodb/mongo-cxx-driver
REF r3.1.1
SHA512 ba8a735e5645cbce4497df71a4577e891d507f577dbd5270ec8a82e54c39c2806bf2ff4848b621f18b36d31fb6031e5b4211972b661c43009bff0ed7ab6cf338
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/disable_test_and_example.patch
${CMAKE_CURRENT_LIST_DIR}/disable_shared.patch
${CMAKE_CURRENT_LIST_DIR}/fix-uwp.patch
HEAD_REF master
PATCHES
"${CURRENT_PORT_DIR}/disable_test_and_example.patch"
"${CURRENT_PORT_DIR}/disable_shared.patch"
"${CURRENT_PORT_DIR}/fix-uwp.patch"
"${CURRENT_PORT_DIR}/disable-c2338-mongo-cxx-driver.patch"
)
vcpkg_configure_cmake(

View File

@ -1,12 +0,0 @@
diff --git a/mongocxx/config/export.hpp b/mongocxx/config/export.hpp
index 61a3e74..7fc951c 100644
--- a/mongocxx/config/export.hpp
+++ b/mongocxx/config/export.hpp
@@ -2,6 +2,7 @@
#ifndef MONGOCXX_API_H
#define MONGOCXX_API_H
+#define MONGOCXX_STATIC
#ifdef MONGOCXX_STATIC
# define MONGOCXX_API
# define MONGOCXX_PRIVATE