Ver código fonte

Added support for custom windres path. (#126)

Brucey 2 anos atrás
pai
commit
a42e66ca24
1 arquivos alterados com 8 adições e 7 exclusões
  1. 8 7
      make.bmk

+ 8 - 7
make.bmk

@@ -570,8 +570,9 @@
 		ext = ""
 		ext = ""
 	end
 	end
 
 
-	local windres =  bmk.MinGWExePrefix() .. "windres" .. ext
-	local windresPath = bmk.MinGWBinPath() .. "/" .. windres
+	local windres = bmk.Option("path_to_windres", bmk.MinGWBinPath() .. "/" .. bmk.MinGWExePrefix() .. "windres") .. ext
+	local windresExe = sys.StripDir(windres)
+	local windresDir = sys.ExtractDir(windres)
 	
 	
 	local outfile = %outfile%
 	local outfile = %outfile%
 	local undecorated_outfile = outfile
 	local undecorated_outfile = outfile
@@ -591,14 +592,14 @@
 		outfile = outfile .. decoration
 		outfile = outfile .. decoration
 	end
 	end
 
 
-	if sys.FileType(windresPath) == 0 then
+	if sys.FileType(windres) == 0 then
 		if bmk.VerboseBuild() == 1 then
 		if bmk.VerboseBuild() == 1 then
-			print("windres" .. ext .. " not found in '" .. bmk.MinGWBinPath() .. "'")
+			print(windresExe .. " not found in '" .. windresDir .. "'. Unable to apply any manifest files.")
 		end
 		end
 		return
 		return
 	end
 	end
 	
 	
-	windres = bmk.Quote(windres)
+	windresExe = bmk.Quote(windresExe)
 	
 	
 	if bmk.VerboseBuild() == 1 then
 	if bmk.VerboseBuild() == 1 then
 		print("Compiling resources...")
 		print("Compiling resources...")
@@ -753,11 +754,11 @@
 	
 	
 		if futils.SaveText(resource_path, resource) then
 		if futils.SaveText(resource_path, resource) then
 		
 		
-			local cmd = windres .. " -i " .. bmk.Quote(resource_path) .. " -o " .. object_path
+			local cmd = windresExe .. " -i " .. bmk.Quote(resource_path) .. " -o " .. object_path
 
 
 			-- windres should be run from its location in order to avoid issues with spaces in paths
 			-- windres should be run from its location in order to avoid issues with spaces in paths
 			local cwd = sys.CurrentDir()
 			local cwd = sys.CurrentDir()
-			sys.ChangeDir(bmk.MinGWBinPath())
+			sys.ChangeDir(windresDir)
 			
 			
 			bmk.Sys(cmd)
 			bmk.Sys(cmd)