Skip to content

Commit 60d3e8e

Browse files
authored
Merge pull request #189 from thelfer/187-add-a-message-stating-that-the-dependency-to-tbb-can-be-removed-if-parallel-stl-is-disabled-when-compiling-with-libstdc
Fix Issue #187
2 parents f322502 + 1b05c0c commit 60d3e8e

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

cmake/modules/clang.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ if(enable-parallel-stl-algorithms)
8383
# This is a poor test to check of libstc++ is used
8484
if(UNIX AND NOT APPLE)
8585
if(NOT enable-libcxx)
86-
find_package(TBB REQUIRED)
86+
find_package(TBB)
87+
if(NOT TBB_FOUND)
88+
message(FATAL_ERROR "Intel Threading Building Blocks library (TBB) is required by libstdc++ to support parallel STL algorithms. You may want to disable support for those parallel algorithms by passing -Denable-parallel-stl-algorithms=OFF to cmake")
89+
endif(NOT TBB_FOUND)
8790
list(APPEND MGIS_REQUIRED_ADDITIONAL_PACKAGES "TBB")
8891
list(APPEND MGIS_ADDITIONAL_LIBRARIES "TBB::tbb")
8992
endif(NOT enable-libcxx)

cmake/modules/gcc.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ endif(enable-sanitize-options)
111111
set(COMPILER_C_WARNINGS "-Wall -W -pedantic")
112112

113113
if(enable-parallel-stl-algorithms)
114-
find_package(TBB REQUIRED)
114+
find_package(TBB)
115+
if(NOT TBB_FOUND)
116+
message(FATAL_ERROR "Intel Threading Building Blocks library (TBB) is required by libstdc++ to support parallel STL algorithms. You may want to disable support for those parallel algorithms by passing -Denable-parallel-stl-algorithms=OFF to cmake")
117+
endif(NOT TBB_FOUND)
115118
list(APPEND MGIS_REQUIRED_ADDITIONAL_PACKAGES "TBB")
116119
list(APPEND MGIS_ADDITIONAL_LIBRARIES "TBB::tbb")
117120
endif(enable-parallel-stl-algorithms)

0 commit comments

Comments
 (0)