Blender Git Commit Log

Git Commits -> Revision 9174793

Revision 9174793 by Sergey Sharybin (compositor-2016)
June 8, 2016, 19:45 (GMT)
CMake: Solve compilation error with pre-compiled libraries and new GCC-6

Since version 6 G++ switched to C++11 by default, which breaks some logic
around WITH_CXX11 checks in out CMake files, leading to compilation errors.
This is easy to solve by explicitly enabling older C++ standard when C++11
was not explicitly enabled by CMake options.

However, G++-6 will also use new ABI by default even if older standard was
specified in the compiler options. This is being addressed by a special
define flag.

This tricks made it possible to use new G++-6 without need to recompile
any of pre-compiled libraries.

However, this might break compilation with existing system libraries, which
might already be using new ABI. We can't address this automatically, so
now we simply default WITH_C11 and WITH_CXX11 options to whatever defaults
of the current compiler are. This means, for G++-6 we'll set WITH_CXX11 to
truth. This should make linking with system libraries working just fine,
but to make pre-compiled libraries we still might need to disable CXX11.

This should work fine work for a new environments with G++-6 and install_deps
script run from scratch there, because C++ standard will be the same for
both Blender dependencies and Blender itself.

Commit Details:

Full Hash: 91747930a1f747c6e281e9b96eb0168bc517bbb5
Parent Commit: bfa2afb
Committed By: Jeroen Bakker
Lines Changed: +31, -3

2 Modified Paths:

/build_files/cmake/macros.cmake (+9, -1) (Diff)
/CMakeLists.txt (+22, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021