diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-04-07 21:59:29 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-04-08 07:11:18 -0700 |
| commit | fbb38a7682d43bd4ddc849e085347ef33978e240 (patch) | |
| tree | ae56b5101f4cad3bec47e53e27b5016cd7ff0146 /lib/std/Build/Module.zig | |
| parent | 6dcbad780cb716fe1d2a4b2ce201a757ea7f03a4 (diff) | |
| download | zig-fbb38a7682d43bd4ddc849e085347ef33978e240.tar.gz zig-fbb38a7682d43bd4ddc849e085347ef33978e240.zip | |
std.Build: fix regression in Step.ConfigHeader
Commit 0b7123f41d66bdda4da29d59623299d47b29aefb regressed the
`include_path` option of ConfigHeader which is intended to set the path,
including subdirectories, that C code would pass to an include
directive.
For example if it passes
.include_path = "config/config.h",
Then the C code should be able to have
#include "config/config.h"
This regressed https://github.com/andrewrk/nasm/ but this commit fixes
it.
Diffstat (limited to 'lib/std/Build/Module.zig')
| -rw-r--r-- | lib/std/Build/Module.zig | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig index a5e95783c6..02386de430 100644 --- a/lib/std/Build/Module.zig +++ b/lib/std/Build/Module.zig @@ -694,7 +694,9 @@ pub fn appendZigProcessFlags( } }, .config_header_step => |config_header| { - try zig_args.appendSlice(&.{ "-I", std.fs.path.dirname(config_header.output_file.getPath()).? }); + const full_file_path = config_header.output_file.getPath(); + const header_dir_path = full_file_path[0 .. full_file_path.len - config_header.include_path.len]; + try zig_args.appendSlice(&.{ "-I", header_dir_path }); }, } } |
