diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-09-15 15:01:10 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-09-16 10:47:50 +0200 |
commit | 1dd35faf13c50cd2f19ea1916170326cba4106b5 (patch) | |
tree | cd597feb81430f3a9e627e1aa77fd28b78a9fa42 /etc/defaults | |
parent | b1c9c5146c017f9286ed01b562a043991e13be15 (diff) | |
download | justbuild-1dd35faf13c50cd2f19ea1916170326cba4106b5.tar.gz |
abseil: Precisely replicate original flags
Diffstat (limited to 'etc/defaults')
-rw-r--r-- | etc/defaults/CC/TARGETS.absl | 205 |
1 files changed, 188 insertions, 17 deletions
diff --git a/etc/defaults/CC/TARGETS.absl b/etc/defaults/CC/TARGETS.absl index 836aa8b3..e93df7bc 100644 --- a/etc/defaults/CC/TARGETS.absl +++ b/etc/defaults/CC/TARGETS.absl @@ -1,23 +1,194 @@ { "defaults": { "type": ["CC", "defaults"] + , "arguments_config": + ["COMPILER_FAMILY", "OS", "ARCH", "TARGET_ARCH", "ABSL_RANDOM_HWAES"] , "base": [["@", "base", "CC", "defaults"]] , "ADD_CXXFLAGS": - [ "-std=c++20" - , "-Wall" - , "-Wextra" - , "-Wcast-qual" - , "-Wconversion-null" - , "-Wformat-security" - , "-Wmissing-declarations" - , "-Woverlength-strings" - , "-Wpointer-arith" - , "-Wundef" - , "-Wunused-local-typedefs" - , "-Wunused-result" - , "-Wvarargs" - , "-Wvla" - , "-Wwrite-strings" - , "-DNOMINMAX" - ] + { "type": "let*" + , "bindings": + [ [ "COMPILER_FAMILY" + , {"type": "var", "name": "COMPILER_FAMILY", "default": "unknown"} + ] + , [ "OS" + , { "type": "var" + , "name": "OS" + , "default": + {"type": "fail", "msg": "Required variable 'OS' is not set."} + } + ] + , [ "TARGET_ARCH" + , { "type": "var" + , "name": "TARGET_ARCH" + , "default": + { "type": "var" + , "name": "ARCH" + , "default": + {"type": "fail", "msg": "Required variable 'ARCH' is not set."} + } + } + ] + ] + , "body": + { "type": "++" + , "$1": + [ ["-std=c++20"] + , { "type": "case" + , "expr": {"type": "var", "name": "COMPILER_FAMILY"} + , "case": + { "msvc": + [ "/W3" + , "/DNOMINMAX" + , "/DWIN32_LEAN_AND_MEAN" + , "/D_CRT_SECURE_NO_WARNINGS" + , "/D_SCL_SECURE_NO_WARNINGS" + , "/D_ENABLE_EXTENDED_ALIGNED_STORAGE" + , "/bigobj" + , "/wd4005" + , "/wd4068" + , "/wd4180" + , "/wd4244" + , "/wd4267" + , "/wd4503" + , "/wd4800" + ] + , "clang": + { "type": "case" + , "expr": {"type": "var", "name": "OS"} + , "case": + { "windows": + [ "/W3" + , "-Wno-c++98-compat-pedantic" + , "-Wno-conversion" + , "-Wno-covered-switch-default" + , "-Wno-deprecated" + , "-Wno-disabled-macro-expansion" + , "-Wno-double-promotion" + , "-Wno-comma" + , "-Wno-extra-semi" + , "-Wno-extra-semi-stmt" + , "-Wno-packed" + , "-Wno-padded" + , "-Wno-sign-compare" + , "-Wno-float-conversion" + , "-Wno-float-equal" + , "-Wno-format-nonliteral" + , "-Wno-gcc-compat" + , "-Wno-global-constructors" + , "-Wno-exit-time-destructors" + , "-Wno-non-modular-include-in-module" + , "-Wno-old-style-cast" + , "-Wno-range-loop-analysis" + , "-Wno-reserved-id-macro" + , "-Wno-shorten-64-to-32" + , "-Wno-switch-enum" + , "-Wno-thread-safety-negative" + , "-Wno-unknown-warning-option" + , "-Wno-unreachable-code" + , "-Wno-unused-macros" + , "-Wno-weak-vtables" + , "-Wno-zero-as-null-pointer-constant" + , "-Wbitfield-enum-conversion" + , "-Wbool-conversion" + , "-Wconstant-conversion" + , "-Wenum-conversion" + , "-Wint-conversion" + , "-Wliteral-conversion" + , "-Wnon-literal-null-conversion" + , "-Wnull-conversion" + , "-Wobjc-literal-conversion" + , "-Wno-sign-conversion" + , "-Wstring-conversion" + , "/DNOMINMAX" + , "/DWIN32_LEAN_AND_MEAN" + , "/D_CRT_SECURE_NO_WARNINGS" + , "/D_SCL_SECURE_NO_WARNINGS" + , "/D_ENABLE_EXTENDED_ALIGNED_STORAGE" + ] + } + , "default": + [ "-Wall" + , "-Wextra" + , "-Weverything" + , "-Wno-c++98-compat-pedantic" + , "-Wno-conversion" + , "-Wno-covered-switch-default" + , "-Wno-deprecated" + , "-Wno-disabled-macro-expansion" + , "-Wno-double-promotion" + , "-Wno-comma" + , "-Wno-extra-semi" + , "-Wno-extra-semi-stmt" + , "-Wno-packed" + , "-Wno-padded" + , "-Wno-sign-compare" + , "-Wno-float-conversion" + , "-Wno-float-equal" + , "-Wno-format-nonliteral" + , "-Wno-gcc-compat" + , "-Wno-global-constructors" + , "-Wno-exit-time-destructors" + , "-Wno-non-modular-include-in-module" + , "-Wno-old-style-cast" + , "-Wno-range-loop-analysis" + , "-Wno-reserved-id-macro" + , "-Wno-shorten-64-to-32" + , "-Wno-switch-enum" + , "-Wno-thread-safety-negative" + , "-Wno-unknown-warning-option" + , "-Wno-unreachable-code" + , "-Wno-unused-macros" + , "-Wno-weak-vtables" + , "-Wno-zero-as-null-pointer-constant" + , "-Wbitfield-enum-conversion" + , "-Wbool-conversion" + , "-Wconstant-conversion" + , "-Wenum-conversion" + , "-Wint-conversion" + , "-Wliteral-conversion" + , "-Wnon-literal-null-conversion" + , "-Wnull-conversion" + , "-Wobjc-literal-conversion" + , "-Wno-sign-conversion" + , "-Wstring-conversion" + ] + } + } + , "default": + [ "-Wall" + , "-Wextra" + , "-Wcast-qual" + , "-Wconversion-null" + , "-Wmissing-declarations" + , "-Woverlength-strings" + , "-Wpointer-arith" + , "-Wunused-local-typedefs" + , "-Wunused-result" + , "-Wvarargs" + , "-Wvla" + , "-Wwrite-strings" + , "-Wno-missing-field-initializers" + , "-Wno-sign-compare" + ] + } + , { "type": "if" + , "cond": {"type": "var", "name": "ABSL_RANDOM_HWAES"} + , "then": + { "type": "case" + , "expr": {"type": "var", "name": "TARGET_ARCH"} + , "case": + { "arm": ["-mfpu=neon"] + , "arm64": ["-march=armv8-a+crypto"] + , "x86_64": + { "type": "case" + , "expr": {"type": "var", "name": "COMPILER_FAMILY"} + , "case": {"msvc": []} + , "default": ["-maes", "-msse4.1"] + } + } + } + } + ] + } + } } } |