Commits

Dimitar Trendafilov committed 04b6e27 Merge

* Merged with external projects configuration

Comments (0)

Files changed (2)

src/actions/make/make_cpp.lua

 
 	function cpp.buildcommand(prj)
 		local flags = iif(prj.language == "C", '$(CC) $(CFLAGS)', '$(CXX) $(CXXFLAGS)')
-		_p('\t$(SILENT) %s -o "$@" -MF $(@:%%.o=%%.d) -c "$<"', flags)
+		_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.o=%%.d)" -c "$<"', flags)
 	end
 
 
 		_p('  CPPFLAGS  += %s $(DEFINES) $(INCLUDES)', table.concat(toolset.getcppflags(cfg), " "))
 		_p('  CFLAGS    += $(CPPFLAGS) $(ARCH) %s', table.concat(table.join(toolset.getcflags(cfg), cfg.buildoptions), " "))
 		_p('  CXXFLAGS  += $(CFLAGS) %s', table.concat(toolset.getcxxflags(cfg), " "))
-		_p('  LDFLAGS   += %s', table.concat(table.join(toolset.getldflags(cfg), cfg.linkoptions), " "))
+
+		local ldflags = {}
+		for _, ldflag in ipairs(table.join(toolset.getldflags(cfg), cfg.linkoptions)) do
+			table.insert(ldflags, make.esc(ldflag))
+		end
+		_p('  LDFLAGS   += %s', table.concat(ldflags, " "))
 	
 		local resflags = table.join(toolset.getdefines(cfg.resdefines), toolset.getincludedirs(cfg, cfg.resincludedirs), cfg.resoptions)
 		_p('  RESFLAGS  += $(DEFINES) $(INCLUDES) %s', table.concat(resflags, " "))
 --
 
 	function cpp.linkconfig(cfg, toolset)
-		local flags = toolset.getlinks(cfg)
+		local flags = {}
+		for _, flag in ipairs(toolset.getlinks(cfg)) do
+			table.insert(flags, make.esc(flag))
+		end
+		
 		_p('  LIBS      += %s', table.concat(flags, " "))
 		
 		local deps = config.getlinks(cfg, "siblings", "fullpath")
 
 	function cpp.buildcommand_old(iscfile)
 		local flags = iif(iscfile, '$(CC) $(CFLAGS)', '$(CXX) $(CXXFLAGS)')
-		_p('\t$(SILENT) %s -o "$@" -MF $(@:%%.o=%%.d) -c "$<"', flags)
+		_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.o=%%.d)" -c "$<"', flags)
 	end
 
 

src/actions/make/make_solution.lua

 			for prj in solution.eachproject_ng(sln) do
 				local prjcfg = project.getconfig(prj, cfg.buildcfg, cfg.platform)
 				if prjcfg then
-					_p('  %s_config = %s', make.tovar(prj.name), prjcfg.shortname)
+					local cfgname = prjcfg.shortname
+					if prj.external then
+						cfgname = prjcfg.buildcfg
+					end
+					_p('  %s_config = %s', make.tovar(prj.name), make.esc(cfgname))
 				end
 			end
 			_p('endif')