Skip to content

Commit

Permalink
Check that liblzma has lzma_cputhreads(), to fix Mac build failure. F…
Browse files Browse the repository at this point in the history
…ixes #102. (#103)

* Check that liblzma has lzma_threads when building

* Fix has_lzma_cputhreads.cpp location
  • Loading branch information
pdimov authored and mclow committed Nov 19, 2019
1 parent 64abdfc commit 601244b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ else
if $(NO_COMPRESSION) != 1 && $(NO_LZMA) != 1
{
using lzma ;

exe has_lzma_cputhreads : ../build/has_lzma_cputhreads.cpp /lzma//lzma ;
explicit has_lzma_cputhreads ;

lzma-requirements =
[ ac.check-library /lzma//lzma : <library>/lzma//lzma
<source>lzma.cpp ] ;
<source>lzma.cpp ]
[ check-target-builds has_lzma_cputhreads
: : <define>BOOST_IOSTREAMS_LZMA_NO_MULTITHREADED=1 ] ;
}
else
{
Expand Down
10 changes: 10 additions & 0 deletions build/has_lzma_cputhreads.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2019 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

#include <lzma.h>

int main()
{
return lzma_cputhreads();
}

0 comments on commit 601244b

Please sign in to comment.