File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
nix-meson-build-support/common Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,26 @@ if cxx.get_id() == 'clang'
4242 add_project_arguments (' -fpch-instantiate-templates' , language : ' cpp' )
4343endif
4444
45+ # Detect if we're using libstdc++ (GCC's standard library)
46+ # libstdc++ uses Intel TBB as backend for C++17 parallel algorithms when <execution> is included.
47+ # boost::concurrent_flat_map includes <execution>, which would require linking against TBB.
48+ # Since we don't actually use parallel algorithms, disable the TBB backend to avoid the dependency.
49+ # TBB is a dependency of blake3 and leaking into our build environment.
50+ is_using_libstdcxx = cxx.compiles(
51+ '''
52+ #include <ciso646>
53+ #ifndef __GLIBCXX__
54+ #error "not libstdc++"
55+ #endif
56+ int main() { return 0; }
57+ ''' ,
58+ name : ' using libstdc++' ,
59+ )
60+
61+ if is_using_libstdcxx
62+ add_project_arguments (' -D_GLIBCXX_USE_TBB_PAR_BACKEND=0' , language : ' cpp' )
63+ endif
64+
4565# Darwin ld doesn't like "X.Y.ZpreABCD+W"
4666nix_soversion = meson .project_version().split(' +' )[0 ].split(' pre' )[0 ]
4767
You can’t perform that action at this time.
0 commit comments