summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/defaults/CC/TARGETS.grpc102
-rw-r--r--etc/import/TARGETS.grpc2
-rw-r--r--etc/repos.json9
3 files changed, 111 insertions, 2 deletions
diff --git a/etc/defaults/CC/TARGETS.grpc b/etc/defaults/CC/TARGETS.grpc
new file mode 100644
index 00000000..608966c2
--- /dev/null
+++ b/etc/defaults/CC/TARGETS.grpc
@@ -0,0 +1,102 @@
+{ "defaults":
+ { "type": ["CC", "defaults"]
+ , "arguments_config": ["DEBUG", "OS", "COMPILER_FAMILY"]
+ , "base": [["@", "base", "CC", "defaults"]]
+ , "ADD_CFLAGS":
+ { "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."}
+ }
+ ]
+ ]
+ , "body":
+ { "type": "++"
+ , "$1":
+ [ ["-std=c99"]
+ , { "type": "case"
+ , "expr": {"type": "var", "name": "COMPILER_FAMILY"}
+ , "case": {"msvc": []}
+ , "default":
+ [ "-Wall"
+ , "-Wextra"
+ , "-DOSATOMIC_USE_INLINED=1"
+ ]
+ }
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then": ["-D_DEBUG", "-DDEBUG"]
+ , "else": ["-Wframe-larger-than=16384"]
+ }
+ , { "type": "case"
+ , "expr": {"type": "var", "name": "OS"}
+ , "case":
+ { "windows":
+ [ "-D_WIN32_WINNT=0x0600"
+ , "-DWIN32_LEAN_AND_MEAN"
+ , "-D_HAS_EXCEPTIONS=0"
+ , "-DUNICODE"
+ , "-D_UNICODE"
+ , "-DNOMINMAX"
+ ]
+ }
+ }
+ ]
+ }
+ }
+ , "ADD_CXXFLAGS":
+ { "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."}
+ }
+ ]
+ ]
+ , "body":
+ { "type": "++"
+ , "$1":
+ [ ["-std=c++20"]
+ , { "type": "case"
+ , "expr": {"type": "var", "name": "COMPILER_FAMILY"}
+ , "case": {"msvc": []}
+ , "default":
+ [ "-Wall"
+ , "-Wextra"
+ , "-DOSATOMIC_USE_INLINED=1"
+ ]
+ }
+ , { "type": "if"
+ , "cond": {"type": "var", "name": "DEBUG"}
+ , "then": ["-D_DEBUG", "-DDEBUG"]
+ , "else": ["-Wframe-larger-than=16384"]
+ }
+ , { "type": "case"
+ , "expr": {"type": "var", "name": "OS"}
+ , "case":
+ { "windows":
+ [ "-D_WIN32_WINNT=0x0600"
+ , "-DWIN32_LEAN_AND_MEAN"
+ , "-D_HAS_EXCEPTIONS=0"
+ , "-DUNICODE"
+ , "-D_UNICODE"
+ , "-DNOMINMAX"
+ ]
+ }
+ }
+ ]
+ }
+ }
+ }
+}
diff --git a/etc/import/TARGETS.grpc b/etc/import/TARGETS.grpc
index dd794f27..c97f850f 100644
--- a/etc/import/TARGETS.grpc
+++ b/etc/import/TARGETS.grpc
@@ -1518,7 +1518,7 @@
, "grpc++_codegen_proto":
{ "type": "export"
, "target": "grpc++_codegen_proto (implementation)"
- , "flexible_config": ["AR", "CC", "CFLAGS", "CXX", "CXXFLAGS", "ENV"]
+ , "flexible_config": ["OS", "AR", "CC", "CFLAGS", "CXX", "CXXFLAGS", "ENV"]
}
, "grpc++_codegen_proto (implementation)":
{ "type": ["@", "rules", "CC", "library"]
diff --git a/etc/repos.json b/etc/repos.json
index 431c44e6..1d360bac 100644
--- a/etc/repos.json
+++ b/etc/repos.json
@@ -81,6 +81,13 @@
, "bindings":
{"base": "rules", "protoc": "protobuf", "grpc": "com_github_grpc_grpc"}
}
+ , "rules-grpc":
+ { "repository": "rules"
+ , "target_root": "defaults"
+ , "rule_root": "rules"
+ , "target_file_name": "TARGETS.grpc"
+ , "bindings": {"base": "rules", "protoc": "protobuf"}
+ }
, "rules-absl":
{ "repository": "rules"
, "target_root": "defaults"
@@ -319,7 +326,7 @@
, "target_root": "import targets"
, "target_file_name": "TARGETS.grpc"
, "bindings":
- { "rules": "rules-protobuf"
+ { "rules": "rules-grpc"
, "protobuf": "protobuf"
, "libssl": "ssl"
, "absl": "com_google_absl"