diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index abb9a9e405..d6fdf23061 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -292,7 +292,9 @@ endif nuttx$(EXEEXT): cleanrel nuttx.rel $(HOSTOBJS) $(Q) echo "LD: nuttx$(EXEEXT)" - $(Q) "$(CC)" $(CCLINKFLAGS) $(LIBPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS) + $(if $(CONFIG_HAVE_CXX),\ + $(Q) "$(CXX)" $(CCLINKFLAGS) $(LIBPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS),\ + $(Q) "$(CC)" $(CCLINKFLAGS) $(LIBPATHS) -o $(TOPDIR)/$@ nuttx.rel $(HOSTOBJS) $(DRVLIB) $(STDLIBS)) $(Q) $(NM) $(TOPDIR)/$@ | \ grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \ sort > $(TOPDIR)/System.map