I use Bazel as build system. I have a cc_library
rule working well on Linux. I would like my code to compile on Windows where some options may be different. For example, '-std=c++14'
/ '/std:c++14'
, or "-lpthread"
.
cc_library(
name = "name",
hdrs = ["file.hpp"],
srcs = ["file.cpp"],
copts = ['-std=c++14'] # '/std:c++14' for Windows
linkopts = ["-lpthread"],
visibility = ["//visibility:public"],
)
What is the bazelistic way to handle this? I have seen Platforms but it seems overkill and I don't understand if it is meant for this.