Skip to content

Commit 8dd16b4

Browse files
authored
Allow CXX environment variable to override g++ for musl build (#500)
Signed-off-by: David A. Ramos <[email protected]>
1 parent 4112a22 commit 8dd16b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

grpc-sys/build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
7575
println!("cargo:rustc-link-lib=framework=CoreFoundation");
7676
}
7777

78-
if env::var("CARGO_CFG_TARGET_ENV").unwrap() == "musl" {
78+
if let Some(val) = get_env("CXX") {
79+
config.define("CMAKE_CXX_COMPILER", val);
80+
} else if env::var("CARGO_CFG_TARGET_ENV").unwrap() == "musl" {
7981
config.define("CMAKE_CXX_COMPILER", "g++");
8082
}
8183

0 commit comments

Comments
 (0)