summarylogtreecommitdiffstats
path: root/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch')
-rw-r--r--0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch b/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch
new file mode 100644
index 000000000000..e05d089e1615
--- /dev/null
+++ b/0001-Fix-FindTBB-version-detection-with-TBB-2021.1.1.patch
@@ -0,0 +1,44 @@
+From 941ea13475913ef8322584f7401633de9967ccc8 Mon Sep 17 00:00:00 2001
+From: Alex Stewart <alexs.mac@gmail.com>
+Date: Mon, 15 Mar 2021 14:17:59 +0000
+Subject: [PATCH] Fix FindTBB version detection with TBB >= 2021.1.1
+
+- Raised as issue #669
+
+Change-Id: Ic2fcaf31aef5e303d19a9caef7d6c679325f554a
+---
+ cmake/FindTBB.cmake | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake
+index 5ae7b61..10e540d 100644
+--- a/cmake/FindTBB.cmake
++++ b/cmake/FindTBB.cmake
+@@ -429,10 +429,23 @@ findpkg_finish(TBB_MALLOC_PROXY tbbmalloc_proxy)
+ #=============================================================================
+ #parse all the version numbers from tbb
+ if(NOT TBB_VERSION)
++ set(TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1
++ "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h")
++ set(TBB_VERSION_FILE_AFTER_TBB_2021_1
++ "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h")
++
++ if (EXISTS "${TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1}")
++ set(TBB_VERSION_FILE "${TBB_VERSION_FILE_PRIOR_TO_TBB_2021_1}")
++ elseif (EXISTS "${TBB_VERSION_FILE_AFTER_TBB_2021_1}")
++ set(TBB_VERSION_FILE "${TBB_VERSION_FILE_AFTER_TBB_2021_1}")
++ else()
++ message(FATAL_ERROR "Found TBB installation: ${TBB_INCLUDE_DIR} "
++ "missing version header.")
++ endif()
+
+ #only read the start of the file
+ file(STRINGS
+- "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h"
++ "${TBB_VERSION_FILE}"
+ TBB_VERSION_CONTENTS
+ REGEX "VERSION")
+
+--
+2.34.1
+