googletest icon indicating copy to clipboard operation
googletest copied to clipboard

Use `-lm` on linux as well.

Open adam-azarchs opened this issue 2 years ago • 4 comments

Not all compilers on linux add it implicitly. It won't do any harm on those which do.

Closes #3878

adam-azarchs avatar Jun 08 '22 00:06 adam-azarchs

Hi, There has been progress with this PR :) ? I confirm that clang requires -lm

dangars avatar Nov 30 '22 19:11 dangars

This is just waiting for someone with permission to actually review and (hopefully) merge it (the test failures shown in the checks output were present on master as well at the time they ran). Our team has been using this branch for a long time now.

adam-azarchs avatar Nov 30 '22 21:11 adam-azarchs

Hi,

I think that Bazel 6 allows to do a selection depending on the compiler (gcc or clang), see @bazel_tools//tools/cpp:compiler

Maybe -lm can be added only for clang, but I think that this would require Bazel 6.

dangars avatar Dec 02 '22 17:12 dangars

Yes I think that would require bazel 6. And even after it's been released, it'll be a while before bazel 6 can be assumed.

adam-azarchs avatar Dec 11 '22 01:12 adam-azarchs