Skip to content

Commit dd1249b

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 19ca3de + 46b94d4 commit dd1249b

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

crates/optix_sys/build.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@ use std::env;
88
// to a lib and link it in so that we have the initialization and C function logic.
99
fn main() {
1010
let out_dir = env::var("OUT_DIR").unwrap();
11-
let mut header = find_optix_root().expect(
11+
let mut optix_include = find_optix_root().expect(
1212
"Unable to find the OptiX SDK, make sure you installed it and
1313
that OPTIX_ROOT or OPTIX_ROOT_DIR are set",
1414
);
15-
header = header.join("include");
16-
let cuda_dir = find_cuda_root()
17-
.expect(
18-
"Unable to find the CUDA SDK, make sure you
19-
installed it and that CUDA_ROOT is set",
20-
)
21-
.join("include");
15+
16+
optix_include = optix_include.join("include");
17+
18+
let mut cuda_include = find_cuda_root().expect(
19+
"Unable to find the CUDA Toolkit, make sure you installed it and
20+
that CUDA_ROOT, CUDA_PATH or CUDA_TOOLKIT_ROOT_DIR are set",
21+
);
22+
cuda_include = cuda_include.join("include");
2223

2324
cc::Build::new()
2425
.file("./optix_stubs.c")
25-
.include(cuda_dir)
26-
.include(header)
26+
.include(optix_include)
27+
.include(cuda_include)
2728
.cpp(false)
2829
.compile("optix_stubs");
2930

crates/rustc_codegen_nvvm/build.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ fn rustc_llvm_build() {
166166
if flag.starts_with("-flto") {
167167
continue;
168168
}
169+
// ignore flags that aren't supported in gcc 8
170+
if flag == "-Wcovered-switch-default" {
171+
continue;
172+
}
173+
if flag == "-Wstring-conversion" {
174+
continue;
175+
}
176+
if flag == "-Werror=unguarded-availability-new" {
177+
continue;
178+
}
169179

170180
cfg.flag(flag);
171181
}
@@ -183,7 +193,7 @@ fn rustc_llvm_build() {
183193
build_helper::rerun_if_changed(Path::new("rustc_llvm_wrapper"));
184194
cfg.file("rustc_llvm_wrapper/RustWrapper.cpp")
185195
.file("rustc_llvm_wrapper/PassWrapper.cpp")
186-
.include("rustc_llvm_wrapper/rustllvm.h")
196+
.include("rustc_llvm_wrapper")
187197
.cpp(true)
188198
.cpp_link_stdlib(None) // we handle this below
189199
.compile("llvm-wrapper");
@@ -241,7 +251,7 @@ fn rustc_llvm_build() {
241251

242252
// Link in the system libraries that LLVM depends on
243253
#[cfg(not(target_os = "windows"))]
244-
link_llvm_system_libs(&llvm_config);
254+
link_llvm_system_libs(&llvm_config, required_components);
245255

246256
// LLVM ldflags
247257
//
@@ -330,10 +340,14 @@ fn rustc_llvm_build() {
330340
}
331341

332342
#[cfg(not(target_os = "windows"))]
333-
fn link_llvm_system_libs(llvm_config: &Path) {
343+
fn link_llvm_system_libs(llvm_config: &Path, components: &[&str]) {
334344
let mut cmd = Command::new(&llvm_config);
335345
cmd.arg("--system-libs");
336346

347+
for comp in components {
348+
cmd.arg(comp);
349+
}
350+
337351
for lib in output(&mut cmd).split_whitespace() {
338352
let name = if let Some(stripped) = lib.strip_prefix("-l") {
339353
stripped

0 commit comments

Comments
 (0)