Bladeren bron

cxx files use CPP_OPTS

Changed compiler version calculation.
Brucey 2 jaren geleden
bovenliggende
commit
2fdd34d76a
5 gewijzigde bestanden met toevoegingen van 47 en 34 verwijderingen
  1. 6 0
      CHANGELOG
  2. 1 1
      bmk_config.bmx
  3. 6 6
      bmk_cores_macos.bmx
  4. 1 1
      bmk_make.bmx
  5. 33 26
      bmk_ng.bmx

+ 6 - 0
CHANGELOG

@@ -1,3 +1,9 @@
+## [3.51] - 2023-03-02
+### Fixed
+ - .cxx files use CPP_OPTS.
+### Changed
+ - Compiler version calculation.
+
 ## [3.50] - 2022-07-08
 ## [3.50] - 2022-07-08
 ### Added
 ### Added
  - moduleinfo variable opts - cc_vopt, etc.
  - moduleinfo variable opts - cc_vopt, etc.

+ 1 - 1
bmk_config.bmx

@@ -10,7 +10,7 @@ Import brl.map
 
 
 Import "stringbuffer_core.bmx"
 Import "stringbuffer_core.bmx"
 
 
-Const BMK_VERSION:String = "3.50"
+Const BMK_VERSION:String = "3.51"
 
 
 Const ALL_SRC_EXTS$="bmx;i;c;m;h;cpp;cxx;mm;hpp;hxx;s;cc;asm;S"
 Const ALL_SRC_EXTS$="bmx;i;c;m;h;cpp;cxx;mm;hpp;hxx;s;cc;asm;S"
 
 

+ 6 - 6
bmk_cores_macos.bmx

@@ -7,9 +7,9 @@ Import "macos/NSProcessInfo_PECocoaBackports.m"
 ?
 ?
 
 
 Extern
 Extern
-?x64
-	Function sysctlbyname:Int(name:Byte Ptr, count:Int Ptr, size:Long Ptr, a:Byte Ptr, b:Int)
-?Not x64
+?bmxng
+	Function sysctlbyname:Int(name:Byte Ptr, count:Int Ptr, size:Size_T Ptr, a:Byte Ptr, b:Size_T)
+?Not bmxng
 	Function sysctlbyname:Int(name:Byte Ptr, count:Int Ptr, size:Int Ptr, a:Byte Ptr, b:Int)
 	Function sysctlbyname:Int(name:Byte Ptr, count:Int Ptr, size:Int Ptr, a:Byte Ptr, b:Int)
 ?
 ?
 End Extern
 End Extern
@@ -18,9 +18,9 @@ Function GetCoreCount:Int()
 	Global count:Int
 	Global count:Int
 
 
 	If Not count Then
 	If Not count Then
-?x64
-		Local l:Long = 4
-?Not x64
+?bmxng
+		Local l:Size_T = 4
+?Not bmxng
 		Local l:Int = 4
 		Local l:Int = 4
 ?
 ?
 		sysctlbyname("hw.ncpu", Varptr count, Varptr l,Null,0)
 		sysctlbyname("hw.ncpu", Varptr count, Varptr l,Null,0)

+ 1 - 1
bmk_make.bmx

@@ -757,7 +757,7 @@ Type TBuildManager Extends TCallback
 								Print s
 								Print s
 							End If
 							End If
 
 
-							If m.path.EndsWith(".cpp") Or m.path.EndsWith("cc") Or m.path.EndsWith("mm") Then
+							If m.path.EndsWith(".cpp") Or m.path.EndsWith(".cc") Or m.path.EndsWith(".mm") Or m.path.EndsWith(".cxx") Then
 								CompileC m.path, m.obj_path, m.GetIncludePaths() + " " + m.cc_opts + " " + m.cpp_opts
 								CompileC m.path, m.obj_path, m.GetIncludePaths() + " " + m.cc_opts + " " + m.cpp_opts
 							ElseIf m.path.EndsWith(".S") Or m.path.EndsWith("asm") Then
 							ElseIf m.path.EndsWith(".S") Or m.path.EndsWith("asm") Then
 								AssembleNative m.path, m.obj_path
 								AssembleNative m.path, m.obj_path

+ 33 - 26
bmk_ng.bmx

@@ -513,7 +513,6 @@ Type TBMK
 		Else	
 		Else	
 			process = CreateProcess("gcc --version")
 			process = CreateProcess("gcc --version")
 		End If
 		End If
-		Local s:String
 		
 		
 		If Not process Then
 		If Not process Then
 			Throw "Cannot find a valid GCC compiler. Please check your paths and environment."
 			Throw "Cannot find a valid GCC compiler. Please check your paths and environment."
@@ -530,14 +529,6 @@ Type TBMK
 			
 			
 			If line.startswith("gcc") Then
 			If line.startswith("gcc") Then
 				compiler = "gcc"
 				compiler = "gcc"
-				Local parts:String[] = line.split(" ")
-				
-				rawVersion = parts[parts.length - 1].Trim()
-				Local values:String[] = rawVersion.split(".")
-				For Local v:String = EachIn values
-					Local n:String = "0" + v
-					s:+ n[n.length - 2..]
-				Next
 			Else If line.startswith("Target:") Then
 			Else If line.startswith("Target:") Then
 				_target = line[7..].Trim()
 				_target = line[7..].Trim()
 			Else
 			Else
@@ -545,23 +536,6 @@ Type TBMK
 				If pos >= 0 Then
 				If pos >= 0 Then
 					compiler = "clang"
 					compiler = "clang"
 					_clang = True
 					_clang = True
-					s = line[pos + 6..line.find(")", pos)]
-
-					Local parts:String[] = line.split(" ")
-					For Local i:Int = 0 Until parts.Length
-						If parts[i].StartsWith("(") Then
-							rawVersion = parts[i - 1].Trim()
-
-							s = ""
-							Local values:String[] = rawVersion.split(".")
-							For Local v:String = EachIn values
-								Local n:String = "0" + v
-								s:+ n[n.length - 2..]
-							Next
-							Exit
-						End If
-					Next
-
 				End If
 				End If
 			End If
 			End If
 			
 			
@@ -570,6 +544,39 @@ Type TBMK
 			process.Close()
 			process.Close()
 		End If
 		End If
 
 
+		' get version
+		If Platform() = "win32" Then
+			process = CreateProcess(MinGWBinPath() + "/gcc.exe -dumpversion -dumpfullversion", HIDECONSOLE)
+		Else	
+			process = CreateProcess("gcc -dumpversion -dumpfullversion")
+		End If
+		Local s:String
+		
+		While True
+			Delay 10
+			
+			Local line:String = process.pipe.ReadLine()
+
+			If Not process.Status() And Not line Then
+				Exit
+			End If
+			
+			If Not rawVersion and line Then
+				rawVersion = line.Trim()
+
+				Local values:String[] = rawVersion.split(".")
+				For Local v:String = EachIn values
+					Local n:String = "0" + v
+					s:+ n[n.length - 2..]
+				Next
+			End If
+		
+		Wend
+	
+		If process Then
+			process.Close()
+		End If
+
 		version = s
 		version = s
 		
 		
 		If getVersionNum Then
 		If getVersionNum Then