Fix MSVC linker error (#840)

The -lm linker option is not known to MSVC and setting it triggers
errors in some build systems:

  [6,366 / 6,367] Linking source/exe/envoy-static.exe; 11s remote
  LINK : warning LNK4044: unrecognized option '/lm'; ignored
  LINK : error LNK1218: warning treated as error; no output file generated
  ERROR: C:/source/source/exe/BUILD:22:16: Linking of rule
    '//source/exe:envoy-static' failed (Exit 4044): link.exe failed: error
    executing command

Do not set -lm in case of MSVC.
This commit is contained in:
Dmitry Rozhkov 2020-09-08 17:48:31 +03:00 committed by GitHub
parent 90fd2b60cc
commit 0cd2e3926e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
BUILD
View File

@ -123,7 +123,10 @@ cc_library(
srcs = [":enc_sources"],
hdrs = [":enc_headers"],
copts = STRICT_C_OPTIONS,
linkopts = ["-lm"],
linkopts = select({
":msvc": [],
"//conditions:default": ["-lm"],
}),
deps = [":brotlicommon"],
)