Jason Perkins avatar Jason Perkins committed 1eb2b4f

VC200x requires library names to be wrapped with quotes if they contain spaces

Comments (0)

Files changed (2)

src/actions/vstudio/vs200x_vcproj.lua

 
 	function vc200x.links(cfg)
 		local links = config.getlinks(cfg, "all", "fullpath")
-		links = table.concat(links, " ")
-		links = path.translate(links)
-		return links
+		for i, link in ipairs(links) do
+			if link:find(" ", 1, true) then
+				link = '"' .. link .. '"'
+			end
+			links[i] = path.translate(link)
+		end
+		return table.concat(links, " ")
 	end
 
 

tests/actions/vstudio/vc200x/test_linker_block.lua

 			/>
 		]]
 	end
+
+
+--
+-- Libraries with spaces in the name must be wrapped in quotes.
+--
+
+	function suite.wrapsWithQuotes_onSpaceInLibraryName()
+		links { "My Lib" }
+		prepare()
+		test.capture [[
+			<Tool
+				Name="VCLinkerTool"
+				LinkLibraryDependencies="false"
+				AdditionalDependencies="&quot;My Lib.lib&quot;"
+		]]
+	end
+
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.