Manu Evans avatar Manu Evans committed c19dab2

Added link section to MonoDevelop C/C++ projects

Comments (0)

Files changed (2)

src/actions/vstudio/_vstudio.lua

 		return iif(os.is64bit(), "x64", "x86")
 	end
 
+
 --
 -- Given a project configuration, return a Visual Studio compatible platform name.
 --
 
 	function vstudio.platform(cfg)
-		if cfg.platform then
-			return cfg.platform
-		end
-		return vstudio.defaultPlatform()
+		return cfg.platform or vstudio.defaultPlatform()
 	end
 
 

src/actions/vstudio/monodevelop_cproj.lua

 
 		monodevelop.additionalIncludeDirectories(cfg)
 		monodevelop.additionalLibraryDirectories(cfg)
-		-- libs
+		monodevelop.additionalDependencies(cfg)
 		
 		monodevelop.buildEvents(cfg)
 
 
 
 --
+-- Write out the linker's additionalDependencies element.
+--
+
+	function monodevelop.additionalDependencies(cfg)
+		local links
+		
+		-- check to see if this project uses an external toolset. If so, let the
+		-- toolset define the format of the links
+		local toolset = premake.vstudio.vc200x.toolset(cfg)
+		if toolset then
+			links = toolset.getlinks(cfg, false)
+		else
+			-- VS always tries to link against project dependencies, even when those
+			-- projects are excluded from the build. To work around, linking dependent
+			-- projects is disabled, and sibling projects link explicitly
+			links = config.getlinks(cfg, "all", "fullpath")
+		end
+		
+		if #links > 0 then
+			_x(2,'<Libs>')
+			_x(3,'<Libs>')
+
+			for _, l in ipairs(links) do
+				lib = path.translate(l)
+				_x(4,'<Lib>%s</Lib>', lib)
+			end
+
+			_x(3,'</Libs>')
+			_x(2,'</Libs>')
+		end
+	end
+
+
+--
 -- Write out the pre- and post-build event settings.
 --
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.