Add support for macOS and Clang
All threads resolved!
All threads resolved!
Compare changes
The build of GitCondDB currently assumes use of the GNU compiler and standard library. This MR adds support for other compilers that may or may not use libstdc++
and have differing levels of support for std::filesystem
.
A CMake-time check is implemented to compile a test program progressively check for:
std::filesystem
without additional librariesstdc++fs
or c++fs
boost_filesystem
The required links and compile definitions are then propagated as needed through usage requirements on the GitCondDB target. One slight awkwardness in the current implementation is the need to set the compile definition indicating Boost filesystem usage on the tests. It's PRIVATE
scope to GitCondDB so shouldn't propagate to clients, except that the tests check the internals, and so do need it. Only way around this would be to implement a private "gitconddb_fs.h
" header, generated at CMake-time and #include
d by DBImpl.h
. I'm happy to implement that, but wanted to check first on preferences!
All of this is really a temporary measure until GCC 9 and macOS Catalina are minimum requirements, but hopefully assists portability and adoption with zero impact on existing users.
A couple of additional portability fixes are included:
GNUInstallDirs
for conventional installation variables and locationsPROJECT_
rather than CMAKE_
variables for in-project locations to support usage of GitCondDB as a subproject of others.ALIAS
target "GitCondDB::GitCondDB
" to the primary GitCondDB
target to support usage of GitCondDB as a subproject of others.