Skip to content

Commit ff9596b

Browse files
authored
Fix missing user objects in --lib-create mode (verilator#3780) (verilator#3784)
1 parent 7d807a7 commit ff9596b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/V3EmitMk.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,16 @@ class EmitMk final {
231231
of.puts("\n### Executable rules... (from --exe)\n");
232232
of.puts("VPATH += $(VM_USER_DIR)\n");
233233
of.puts("\n");
234-
for (const string& cppfile : cppFiles) {
235-
const string basename = V3Os::filenameNonExt(cppfile);
236-
// NOLINTNEXTLINE(performance-inefficient-string-concatenation)
237-
of.puts(basename + ".o: " + cppfile + "\n");
238-
of.puts("\t$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -c -o $@ $<\n");
239-
}
234+
}
240235

236+
for (const string& cppfile : cppFiles) {
237+
const string basename = V3Os::filenameNonExt(cppfile);
238+
// NOLINTNEXTLINE(performance-inefficient-string-concatenation)
239+
of.puts(basename + ".o: " + cppfile + "\n");
240+
of.puts("\t$(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -c -o $@ $<\n");
241+
}
242+
243+
if (v3Global.opt.exe()) {
241244
of.puts("\n### Link rules... (from --exe)\n");
242245
of.puts(v3Global.opt.exeName()
243246
+ ": $(VK_USER_OBJS) $(VK_GLOBAL_OBJS) $(VM_PREFIX)__ALL.a $(VM_HIER_LIBS)\n");

0 commit comments

Comments
 (0)