Browse Source

Cross-compile improvements.

Brucey 2 years ago
parent
commit
eec83fbc38
4 changed files with 40 additions and 6 deletions
  1. 6 0
      CHANGELOG
  2. 18 0
      bmk_ng.bmx
  3. 15 5
      make.bmk
  4. 1 1
      version.bmx

+ 6 - 0
CHANGELOG

@@ -1,3 +1,9 @@
+## [3.54] - 2023-05-22
+### Added
+ - Cross-compile improvements.
+### Changed
+ - Version number is now in its own file to assist auto-builds.
+
 ## [3.53] - 2023-05-06
 ## [3.53] - 2023-05-06
 ### Added
 ### Added
  - Coverage generation with -cov option.
  - Coverage generation with -cov option.

+ 18 - 0
bmk_ng.bmx

@@ -347,6 +347,24 @@ Type TBMK
 		End If
 		End If
 	End Method
 	End Method
 
 
+	Method OSPlatform:String()
+?raspberrypi
+		Return "raspberrypi"
+?android
+		Return "android"
+?macos
+		Return "macos"
+?linux
+		Return "linux"
+?win32
+		Return "win32"
+?emscripten
+		Return "emscripten"
+?haiku
+		Return "haiku"
+?
+	End Method
+
 	'returns the app type as a string ("gui", "console" ...)
 	'returns the app type as a string ("gui", "console" ...)
 	Method AppType:String()
 	Method AppType:String()
 		Return opt_apptype
 		Return opt_apptype

+ 15 - 5
make.bmk

@@ -85,7 +85,7 @@
 		bcc_app = bcc_app .. "_ppc"
 		bcc_app = bcc_app .. "_ppc"
 	end
 	end
 	
 	
-	if bmk.Platform() == "win32" then
+	if bmk.OSPlatform() == "win32" then
 		bcc_app = bcc_app .. ".exe"
 		bcc_app = bcc_app .. ".exe"
 	end
 	end
 	
 	
@@ -180,9 +180,14 @@
 				
 				
 	elseif bmk.Platform() == "win32" then
 	elseif bmk.Platform() == "win32" then
 		local prefix = bmk.MinGWExePrefix()
 		local prefix = bmk.MinGWExePrefix()
-		cmd = bmk.Option("path_to_gcc", bmk.MinGWBinPath() .. "/" .. prefix .. "gcc.exe")
+		if bmk.OSPlatform() == "win32" then
+			ext = ".exe"
+		else
+			ext = ""
+		end
+		cmd = bmk.Option("path_to_gcc", bmk.MinGWBinPath() .. "/" .. prefix .. "gcc" .. ext)
 		if ext == "cpp" or ext == "cxx" or ext == "mm" or ext == "cc" then
 		if ext == "cpp" or ext == "cxx" or ext == "mm" or ext == "cc" then
-			cmd = bmk.Option("path_to_gpp", bmk.MinGWBinPath() .. "/" .. prefix .. "g++.exe")
+			cmd = bmk.Option("path_to_gpp", bmk.MinGWBinPath() .. "/" .. prefix .. "g++" .. ext)
 		end
 		end
 		
 		
 	elseif bmk.Platform() == "linux" or bmk.Platform() == "android" or bmk.Platform() == "raspberrypi" or bmk.Platform() == "haiku" then
 	elseif bmk.Platform() == "linux" or bmk.Platform() == "android" or bmk.Platform() == "raspberrypi" or bmk.Platform() == "haiku" then
@@ -559,8 +564,13 @@
 @end
 @end
 
 
 @define make_win32_resource
 @define make_win32_resource
+	if bmk.OSPlatform() == "win32" then
+		ext = ".exe"
+	else
+		ext = ""
+	end
 
 
-	local windres =  bmk.MinGWExePrefix() .. "windres.exe"
+	local windres =  bmk.MinGWExePrefix() .. "windres" .. ext
 	local windresPath = bmk.MinGWBinPath() .. "/" .. windres
 	local windresPath = bmk.MinGWBinPath() .. "/" .. windres
 	
 	
 	local outfile = %outfile%
 	local outfile = %outfile%
@@ -583,7 +593,7 @@
 
 
 	if sys.FileType(windresPath) == 0 then
 	if sys.FileType(windresPath) == 0 then
 		if bmk.VerboseBuild() == 1 then
 		if bmk.VerboseBuild() == 1 then
-			print("windres.exe not found in '" .. bmk.MinGWBinPath() .. "'")
+			print("windres" .. ext .. " not found in '" .. bmk.MinGWBinPath() .. "'")
 		end
 		end
 		return
 		return
 	end
 	end

+ 1 - 1
version.bmx

@@ -1,3 +1,3 @@
 SuperStrict
 SuperStrict
 
 
-Const BMK_VERSION:String = "3.53"
+Const BMK_VERSION:String = "3.54"