| 1 |
"""C++ compile/link options for Protobuf libraries.""" |
| 2 |
|
| 3 |
COPTS = select({ |
| 4 |
"//build_defs:config_msvc": [ |
| 5 |
"/wd4065", # switch statement contains 'default' but no 'case' labels |
| 6 |
"/wd4146", # unary minus operator applied to unsigned type |
| 7 |
"/wd4244", # 'conversion' conversion from 'type1' to 'type2', possible loss of data |
| 8 |
"/wd4251", # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' |
| 9 |
"/wd4267", # 'var' : conversion from 'size_t' to 'type', possible loss of data |
| 10 |
"/wd4305", # 'identifier' : truncation from 'type1' to 'type2' |
| 11 |
"/wd4307", # 'operator' : integral constant overflow |
| 12 |
"/wd4309", # 'conversion' : truncation of constant value |
| 13 |
"/wd4334", # 'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) |
| 14 |
"/wd4355", # 'this' : used in base member initializer list |
| 15 |
"/wd4506", # no definition for inline function 'function' |
| 16 |
"/wd4800", # 'type' : forcing value to bool 'true' or 'false' (performance warning) |
| 17 |
"/wd4996", # The compiler encountered a deprecated declaration. |
| 18 |
], |
| 19 |
"//conditions:default": [ |
| 20 |
"-DHAVE_ZLIB", |
| 21 |
"-Woverloaded-virtual", |
| 22 |
"-Wno-sign-compare", |
| 23 |
"-Wno-nonnull", |
| 24 |
"-Werror", |
| 25 |
], |
| 26 |
}) |
| 27 |
|
| 28 |
# Android and MSVC builds do not need to link in a separate pthread library. |
| 29 |
LINK_OPTS = select({ |
| 30 |
"//build_defs:config_android": [], |
| 31 |
"//build_defs:config_android-stlport": [], |
| 32 |
"//build_defs:config_android-libcpp": [], |
| 33 |
"//build_defs:config_android-gnu-libstdcpp": [], |
| 34 |
"//build_defs:config_android-default": [], |
| 35 |
"//build_defs:config_msvc": [ |
| 36 |
# Suppress linker warnings about files with no symbols defined. |
| 37 |
"-ignore:4221", |
| 38 |
], |
| 39 |
"@platforms//os:macos": [ |
| 40 |
"-lpthread", |
| 41 |
"-lm", |
| 42 |
"-framework CoreFoundation", |
| 43 |
], |
| 44 |
"//conditions:default": [ |
| 45 |
"-lpthread", |
| 46 |
"-lm", |
| 47 |
], |
| 48 |
}) |