This repository was archived by the owner on Jun 30, 2025. It is now read-only.
Description When build glog on Windows you get the following warning when using Visual Studio 2022: unknown option '-std=c++14' for Windows builds.
The reason for this is here .
Abseil has a good way to handle flags for different compilers - could copied here - something like this:
in configure_copts.bzl:
GLOG_MSVC_FLAGS = [
"/std:c++20",
]
GLOG_GCC_FLAGS = [
"-std=c++23",
]
GLOG_CLANG_FLAGS = [
"-std=c++20",
]
GLOG_DEFAULT_COPTS = select({
"//glog:msvc_compiler": GLOG_MSVC_FLAGS,
"//glog:gcc_compiler": GLOG_GCC_FLAGS,
"//glog:clang_compiler": GLOG_CLANG_FLAGS,
"//conditions:default": GLOG_GCC_FLAGS,
})
In BUILD file:
config_setting(
name = "msvc_compiler",
flag_values = {
"@bazel_tools//tools/cpp:compiler": "msvc-cl",
},
visibility = [":__subpackages__"],
)
config_setting(
name = "gcc_compiler",
flag_values = {
"@bazel_tools//tools/cpp:compiler": "gcc",
},
visibility = [":__subpackages__"],
)
config_setting(
name = "clang_compiler",
flag_values = {
"@bazel_tools//tools/cpp:compiler": "clang",
},
visibility = [":__subpackages__"],
)
Reactions are currently unavailable
When build glog on Windows you get the following warning when using Visual Studio 2022:
unknown option '-std=c++14' for Windows builds.The reason for this is here.
Abseil has a good way to handle flags for different compilers - could copied here - something like this:
in
configure_copts.bzl:In BUILD file: