Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-05-30 15:37:07 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-05-30 15:37:33 +0300
commitf0ee7f9544c7fef2499307f05ca87eb44b137408 (patch)
treed5bc3d0c4cdea63041d0887512307ed1b999af6a /build_files
parentce13a7b6095f682ced6c2bda6c4768b6dee2d30e (diff)
CMake: Workaround to get Libmv compiled with latest Gcc
Diffstat (limited to 'build_files')
-rw-r--r--build_files/cmake/macros.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 47fc86c4f20..d34b55e14e0 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -879,8 +879,16 @@ macro(TEST_SHARED_PTR_SUPPORT)
# otherwise it's assumed to be defined in std namespace.
include(CheckIncludeFileCXX)
+ include(CheckCXXSourceCompiles)
set(SHARED_PTR_FOUND FALSE)
- CHECK_INCLUDE_FILE_CXX(memory HAVE_STD_MEMORY_HEADER)
+ # Workaround for newer GCC (6.x+) where C++11 was enabled by default, which lead us
+ # to a situation when there is <unordered_map> include but which can't be used uless
+ # C++11 is enabled.
+ if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
+ set(HAVE_STD_MEMORY_HEADER False)
+ else()
+ CHECK_INCLUDE_FILE_CXX(memory HAVE_STD_MEMORY_HEADER)
+ endif()
if(HAVE_STD_MEMORY_HEADER)
# Finding the memory header doesn't mean that shared_ptr is in std
# namespace.
@@ -888,7 +896,6 @@ macro(TEST_SHARED_PTR_SUPPORT)
# In particular, MSVC 2008 has shared_ptr declared in std::tr1. In
# order to support this, we do an extra check to see which namespace
# should be used.
- include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("#include <memory>
int main() {
std::shared_ptr<int> int_ptr;