From 8782d915eaea495212d2ff429901c3014e7040c4 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 12 May 2026 12:11:35 +0200 Subject: [PATCH] iverilog: run ivlpp only with base path when different from -BP --- driver/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/driver/main.c b/driver/main.c index 95d02e91b..c61a5cf4e 100644 --- a/driver/main.c +++ b/driver/main.c @@ -1547,8 +1547,14 @@ int main(int argc, char **argv) /* Write the preprocessor command needed to preprocess a single file. This may be used to preprocess library files. */ - fprintf(iconfig_file, "ivlpp:%s%civlpp %s -L -F\"%s\" -P\"%s\"\n", - ivlpp_dir, sep, + char ivlpp_prefix[1024]; + if (strcmp(ivlpp_dir, base) != 0) + snprintf(ivlpp_prefix, sizeof(ivlpp_prefix), "%s%c", ivlpp_dir, sep); + else + *ivlpp_prefix = '\0'; + + fprintf(iconfig_file, "ivlpp:%sivlpp %s -L -F\"%s\" -P\"%s\"\n", + ivlpp_prefix, strchr(warning_flags, 'r') ? "-Wredef-all" : strchr(warning_flags, 'R') ? "-Wredef-chg" : "", defines_path, compiled_defines_path