aboutsummaryrefslogtreecommitdiff
path: root/src/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-30 13:40:04 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-30 13:40:04 -0400
commita80a83c49f733b7c9102e192199cde6e65bea871 (patch)
tree37fc270a690a8cb477273a14c1c53d71052dd0a5 /src/compile.c
parent962514a5cb75b6f9067681e6e7ca96cb933f72c5 (diff)
Fix for including header files
Diffstat (limited to 'src/compile.c')
-rw-r--r--src/compile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compile.c b/src/compile.c
index 73b24c25..aa4ddac9 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -4407,10 +4407,12 @@ CORD compile_statement_type_header(env_t *env, ast_t *ast)
return CORD_all("#include \"", Path$as_c_string(path), "\"\n");
}
case USE_HEADER:
- if (use->path[0] == '<')
+ if (use->path[0] == '<') {
return CORD_all("#include ", use->path, "\n");
- else
- return CORD_all("#include \"", use->path, "\"\n");
+ } else {
+ Path_t path = Path$relative_to(Path$from_str(use->path), Path(".build"));
+ return CORD_all("#include \"", Path$as_c_string(path), "\"\n");
+ }
default:
return CORD_EMPTY;
}