Build: fix make deps TBB on Linux, older versions don't support GCC 7.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Tue, 8 Aug 2017 00:46:19 +0000 (02:46 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 29 Dec 2017 23:07:33 +0000 (00:07 +0100)
build_files/build_environment/cmake/tbb.cmake
build_files/build_environment/cmake/versions.cmake

index c4055d55648d1c87bf1bf8e9a752974b4d20f47c..fa5c9029ed06891bb08f39db62600e7ab25e1508 100644 (file)
@@ -23,6 +23,14 @@ set(TBB_EXTRA_ARGS
        -DTBB_BUILD_STATIC=On
 )
 
+if(TBB_VERSION MATCHES 2018)
+       set(TBB_VS_VERSION vs2013)
+elseif(TBB_VERSION MATCHES 2017)
+       set(TBB_VS_VERSION vs2012)
+else()
+       set(TBB_VS_VERSION vs2010)
+endif()
+
 # CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
 ExternalProject_Add(external_tbb
        URL ${TBB_URI}
@@ -30,7 +38,7 @@ ExternalProject_Add(external_tbb
        URL_HASH MD5=${TBB_HASH}
        PREFIX ${BUILD_DIR}/tbb
        PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_tbb.txt ${BUILD_DIR}/tbb/src/external_tbb/CMakeLists.txt &&
-               ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/vs2010/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
+               ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/${TBB_VS_VERSION}/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tbb ${DEFAULT_CMAKE_FLAGS} ${TBB_EXTRA_ARGS}
        INSTALL_DIR ${LIBDIR}/tbb
 )
index e53beeddf4a4773054f51937542cf58622f5a40a..a4aed76ee5ee6b2496e72651673063fec0bbd6dd 100644 (file)
@@ -137,9 +137,16 @@ set(PYTHON_SHORT_VERSION_NO_DOTS 36)
 set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
 set(PYTHON_HASH 2c68846471994897278364fc18730dd9)
 
-set(TBB_VERSION 44_20160128)
-set(TBB_URI https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb${TBB_VERSION}oss_src_0.tgz)
-set(TBB_HASH 9d8a4cdf43496f1b3f7c473a5248e5cc)
+if(UNIX AND NOT APPLE)
+       # Needed to be compatible with GCC 7, other platforms can upgrade later
+       set(TBB_VERSION 2017_U7)
+       set(TBB_URI https://github.com/01org/tbb/archive/${TBB_VERSION}.tar.gz)
+       set(TBB_HASH 364f2a4b80e978f38a69cbf7c466b898)
+else()
+       set(TBB_VERSION 44_20160128)
+       set(TBB_URI https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb${TBB_VERSION}oss_src_0.tgz)
+       set(TBB_HASH 9d8a4cdf43496f1b3f7c473a5248e5cc)
+endif()
 
 set(OPENVDB_VERSION 3.1.0)
 set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)