summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Kuthe2023-04-22 10:38:25 +0000
committerGitHub2023-04-22 10:38:25 +0000
commitb7c62e200e0fbe600855e6a2d492286349cae4ae (patch)
tree7830cc1e6f971cfa7c8b77cefc4e3096a053db7d
parenta1044a6c68bc822021da204f81e1d7c0ba13df31 (diff)
fix windows builds (#6845)
-rw-r--r--helix-loader/src/grammar.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs
index 3dac237c..16955187 100644
--- a/helix-loader/src/grammar.rs
+++ b/helix-loader/src/grammar.rs
@@ -433,11 +433,12 @@ fn build_tree_sitter_library(
for (key, value) in compiler.env() {
command.env(key, value);
}
+
command.args(compiler.args());
// used to delay dropping the temporary object file until after the compilation is complete
let _path_guard;
- if cfg!(all(windows, target_env = "msvc")) {
+ if compiler.is_like_msvc() {
command
.args(["/nologo", "/LD", "/I"])
.arg(header_path)
@@ -455,20 +456,20 @@ fn build_tree_sitter_library(
}
cpp_command.args(compiler.args());
let object_file =
- library_path.with_file_name(format!("{}_scanner.o", &grammar.grammar_id));
+ library_path.with_file_name(format!("{}_scanner.obj", &grammar.grammar_id));
cpp_command
.args(["/nologo", "/LD", "/I"])
.arg(header_path)
.arg("/Od")
.arg("/utf-8")
.arg("/std:c++14")
- .arg("/o")
- .arg(&object_file)
+ .arg(format!("/Fo{}", object_file.display()))
.arg("/c")
.arg(scanner_path);
let output = cpp_command
.output()
.context("Failed to execute C++ compiler")?;
+
if !output.status.success() {
return Err(anyhow!(
"Parser compilation failed.\nStdout: {}\nStderr: {}",