Only check boost dependency if unit_tests or benchmarks are build.