Просмотр исходного кода

Added macOS "arm64" build option.

Added custom macOS toolchain configuration.
woollybah 5 лет назад
Родитель
Сommit
251b088e85
5 измененных файлов с 30 добавлено и 14 удалено
  1. 5 0
      CHANGELOG
  2. 2 2
      bmk_config.bmx
  3. 2 2
      bmk_make.bmx
  4. 3 1
      bmk_modutil.bmx
  5. 18 9
      bmk_util.bmx

+ 5 - 0
CHANGELOG

@@ -1,3 +1,8 @@
+## [3.44] - 2020-07-31
+### Added
+ - macOS "arm64" build option.
+ - Custom macOS toolchain configuration.
+
 ## [3.43] - 2020-07-05
 ### Fixed
  - iOS build configuration.

+ 2 - 2
bmk_config.bmx

@@ -10,7 +10,7 @@ Import brl.map
 
 Import "stringbuffer_core.bmx"
 
-Const BMK_VERSION:String = "3.43"
+Const BMK_VERSION:String = "3.44"
 
 Const ALL_SRC_EXTS$="bmx;i;c;m;h;cpp;cxx;mm;hpp;hxx;s;cc;asm;S"
 
@@ -352,7 +352,7 @@ Function Usage:String(fullUsage:Int = False)
 ?
 		s:+ ")~n"
 		s:+ "~t~tOptions vary depending on the current OS/architecture/installed toolchain and version of bcc.~n"
-		s:+ "~t~t~tMacOS : x86, x64~n"
+		s:+ "~t~t~tMacOS : x86, x64, arm64~n"
 		s:+ "~t~t~tWin32 : x86, x64~n"
 		s:+ "~t~t~tLinux : x86, x64, arm, arm64~n"
 		s:+ "~t~t~tiOS : x86, x64 (simulator), armv7, arm64~n"

+ 2 - 2
bmk_make.bmx

@@ -1773,7 +1773,7 @@ Type TArcTask
 		End If
 		
 		If processor.Platform() = "macos" Or processor.Platform() = "osx" Then
-			cmd="libtool -o "+CQuote(path)
+			cmd=processor.Option(processor.BuildName("libtool"), "libtool") + " -o "+CQuote(path)
 			For Local t$=EachIn oobjs
 				cmd:+" "+CQuote(t)
 			Next
@@ -1788,7 +1788,7 @@ Type TArcTask
 					proc = "x86_64"
 			End Select
 		
-			cmd="libtool -static -arch_only " + proc + " -o "+CQuote(path)
+			cmd= processor.Option(processor.BuildName("libtool"), "libtool") + " -static -arch_only " + proc + " -o "+CQuote(path)
 			For Local t$=EachIn oobjs
 				cmd:+" "+CQuote(t)
 			Next

+ 3 - 1
bmk_modutil.bmx

@@ -655,7 +655,7 @@ Function ValidatePlatformArchitecture()
 				valid = True
 			End If
 		Case "macos", "osx"
-			If arch = "x86" Or arch = "x64" Or arch = "ppc" Then
+			If arch = "x86" Or arch = "x64" Or arch = "ppc" Or arch = "arm64" Then
 				valid = True
 			End If
 		Case "ios"
@@ -722,9 +722,11 @@ Function SetCompilerValues()
 	compilerOptions.Add("macosx86", (processor.Platform() = "macos"Or processor.Platform() = "osx" Or processor.Platform() = "ios") And processor.CPU()="x86")
 	compilerOptions.Add("macosppc", (processor.Platform() = "macos" Or processor.Platform() = "osx") And processor.CPU()="ppc")
 	compilerOptions.Add("macosx64", (processor.Platform() = "macos" Or processor.Platform() = "osx" Or processor.Platform() = "ios") And processor.CPU()="x64")
+	compilerOptions.Add("macosarm64", (processor.Platform() = "macos" Or processor.Platform() = "osx" Or processor.Platform() = "ios") And processor.CPU()="arm64")
 	compilerOptions.Add("osx", processor.Platform() = "macos" Or processor.Platform() = "osx")
 	compilerOptions.Add("osxx86", (processor.Platform() = "macos"Or processor.Platform() = "osx") And processor.CPU()="x86")
 	compilerOptions.Add("osxx64", (processor.Platform() = "macos" Or processor.Platform() = "osx") And processor.CPU()="x64")
+	compilerOptions.Add("osxarm64", (processor.Platform() = "macos" Or processor.Platform() = "osx") And processor.CPU()="arm64")
 	compilerOptions.Add("ios", processor.Platform() = "ios")
 	compilerOptions.Add("iosx86", processor.Platform() = "ios" And processor.CPU()="x86")
 	compilerOptions.Add("iosx64", processor.Platform() = "ios" And processor.CPU()="x64")

+ 18 - 9
bmk_util.bmx

@@ -206,19 +206,28 @@ Function LinkApp( path$,lnk_files:TList,makelib:Int,opts$ )
 	If opt_standalone tmpfile = String(globals.GetRawVar("EXEPATH")) + "/ld." + processor.AppDet() + ".txt.tmp"
 	
 	If processor.Platform() = "macos" Or processor.Platform() = "osx" Then
-		sb.Append("g++")
+		sb.Append(processor.Option(processor.BuildName("gpp"), "g++"))
 
-		If processor.CPU()="ppc" 
-			sb.Append(" -arch ppc" )
-		Else If processor.CPU()="x86"
-			sb.Append(" -arch i386 -read_only_relocs suppress")
-		Else
-			sb.Append(" -arch x86_64")
-		EndIf
+		Select processor.CPU()
+			Case "ppc" 
+				sb.Append(" -arch ppc" )
+			Case "x86"
+				sb.Append(" -arch i386 -read_only_relocs suppress")
+			Case "x64"
+				sb.Append(" -arch x86_64")
+			Case "arm64"
+				sb.Append(" -arch arm64")
+		End Select
+	
+		If processor.Option(processor.BuildName("sysroot"), "") Then
+			sb.Append(" -isysroot ").Append(processor.Option(processor.BuildName("sysroot"), ""))
+		End If
 	
 		sb.Append(" -o ").Append(CQuote( path ))
 	
-		sb.Append(" ").Append(CQuote("-L" +CQuote( BlitzMaxPath()+"/lib" ) ))
+		If processor.BCCVersion() = "BlitzMax" Then
+			sb.Append(" ").Append(CQuote("-L" +CQuote( BlitzMaxPath()+"/lib" ) ))
+		End If
 	
 		If Not opt_dumpbuild Then
 			sb.Append(" -filelist ").Append(CQuote( tmpfile ))