This repository has been archived by the owner on Dec 18, 2021. It is now read-only.
Remove Boost.Thread dependency on macOS and require a modern version of AppleClang that supports thread_local #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey Roland,
this is a small patch that removes the dependency of Boost.Thread on macOS and relies on having a modern version of AppleClang that supports
thread_local
.I recently wanted to install sqlpp11 and sqlpp11-connector-mysql via Vcpkg on macOS and I noticed that the installation would not work and stop with an error if I just executed
vcpkg install sqlpp11 sqlpp11-connector-mysql
in a fresh and empty Vcpkg directory. This should of course automatically install all dependencies but in the case of sqlpp11-connector-mysql it did not and after looking into the error log I noticed that this also needs Boost.Thread on macOS, which is not listed as a dependency in the Vcpkg control file.Now, this of course is not your fault. 馃槃
At first I wanted to supply a quick patch to Vcpkg to add Boost.Thread as a dependency for sqlpp11-connector-mysql on macOS but honestly, that is kinda ugly because that would add 50+ other packages that get installed automatically. And all of that for something that is not really needed anymore.
Modern versions of AppleClang since Xcode 8 (from 2016) support
thread_local
like any other modern compiler so I suggest we drop the reliance on Boost.Thread and simply require AppleClang 8+ on macOS.In practice this is probably not really an issue since even Xcode 8 that was the first to ship with
thread_local
support isn't even supported anymore today and I'd wager that almost all macOS users moved on to newer versions of Xcode and macOS. And, well, the few that did not (for whatever reason) could always use a different compiler.I made a quick test project here (https://github.com/Toxe/cpp-threads) that uses
thread_local
(in thread_local.cpp) and as you can see here (https://travis-ci.com/github/Toxe/cpp-threads/builds/152702468) this builds fine all the way down to Xcode 8.I also checked these changes to sqlpp11-connector-mysql from this PR on macOS with Clang 9, GCC 9 and Xcode 11.3 and this builds without a problem.