try to fix Apple build

- avoid setting the version of libraries when on a mac (otherwise clang
complains with «invalid argument '-current_version 12.2.284' only
allowed with '-dynamiclib’ »)
- avoid compiling tests when their dependencies are not found