mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-15 13:42:40 -07:00
Fixed after removing TBB deprecated APIs
This commit is contained in:
@@ -43,7 +43,13 @@
|
||||
#include <boost/nowide/convert.hpp>
|
||||
#include <boost/nowide/cstdio.hpp>
|
||||
|
||||
#include <tbb/global_control.h>
|
||||
// We are using quite an old TBB 2017 U7, which does not support global control API officially.
|
||||
// Before we update our build servers, let's use the old API, which is deprecated in up to date TBB.
|
||||
#ifdef TBB_HAS_GLOBAL_CONTROL
|
||||
#include <tbb/global_control.h>
|
||||
#else
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
#endif
|
||||
|
||||
#if defined(__linux__) || defined(__GNUC__ )
|
||||
#include <strings.h>
|
||||
@@ -118,7 +124,11 @@ void trace(unsigned int level, const char *message)
|
||||
void disable_multi_threading()
|
||||
{
|
||||
// Disable parallelization so the Shiny profiler works
|
||||
#ifdef TBB_HAS_GLOBAL_CONTROL
|
||||
tbb::global_control(tbb::global_control::max_allowed_parallelism, 1);
|
||||
#else // TBB_HAS_GLOBAL_CONTROL
|
||||
static tbb::task_scheduler_init *tbb_init = new tbb::task_scheduler_init(1);
|
||||
#endif // TBB_HAS_GLOBAL_CONTROL
|
||||
}
|
||||
|
||||
static std::string g_var_dir;
|
||||
|
||||
Reference in New Issue
Block a user