Browse Source

mx2cc_macos now finds MX2_IOS_SDK.

Mark Sibly 8 years ago
parent
commit
e2be8b62d1
3 changed files with 32 additions and 17 deletions
  1. 3 0
      .gitignore
  2. 6 5
      bin/env_macos.txt
  3. 23 12
      src/mx2cc/mx2cc.monkey2

+ 3 - 0
.gitignore

@@ -63,3 +63,6 @@ Mollusk.exe
 /src/mx23d
 
 /modules/mojo3d-physics/tests/assets/E1M1_clean.obj
+
+.com.apple.timemachine.supported
+

+ 6 - 5
bin/env_macos.txt

@@ -70,20 +70,21 @@ PATH=${HOME}/Library/Android/sdk/ndk-bundle:${PATH}
 
 '***** IOS *****
 
-MX2_SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk
-MX2_DEPLOYMENT_TARGET=8.0
+'MX2_IOS_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk
+
+MX2_IOS_DEPLOYMENT_TARGET=8.0
 
 'LD options
-MX2_LD_OPTS_IOS=-arch armv7 -arch arm64 -isysroot ${MX2_SDKROOT}
+MX2_LD_OPTS_IOS=-arch armv7 -arch arm64 -isysroot ${MX2_IOS_SDK}
 MX2_LD_OPTS_IOS_DEBUG=
 MX2_LD_OPTS_IOS_RELEASE=-O3 
 
 'C compiler options
-MX2_CC_OPTS_IOS=-std=gnu99 -arch armv7 -arch arm64 -miphoneos-version-min=${MX2_DEPLOYMENT_TARGET} -isysroot ${MX2_SDKROOT} -fobjc-arc -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality
+MX2_CC_OPTS_IOS=-std=gnu99 -arch armv7 -arch arm64 -miphoneos-version-min=${MX2_IOS_DEPLOYMENT_TARGET} -isysroot ${MX2_IOS_SDK} -fobjc-arc -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality
 MX2_CC_OPTS_IOS_DEBUG=
 MX2_CC_OPTS_IOS_RELEASE=-O3 -DNDEBUG
 
 'C++ compiler options
-MX2_CPP_OPTS_IOS=-std=c++14 -arch armv7 -arch arm64 -miphoneos-version-min=${MX2_DEPLOYMENT_TARGET} -isysroot ${MX2_SDKROOT} -fobjc-arc -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality
+MX2_CPP_OPTS_IOS=-std=c++14 -arch armv7 -arch arm64 -miphoneos-version-min=${MX2_IOS_DEPLOYMENT_TARGET} -isysroot ${MX2_IOS_SDK} -fobjc-arc -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality
 MX2_CPP_OPTS_IOS_DEBUG=-O0 -g
 MX2_CPP_OPTS_IOS_RELEASE=-O3 -DNDEBUG

+ 23 - 12
src/mx2cc/mx2cc.monkey2

@@ -34,7 +34,7 @@ Global opts_time:Bool
 
 Global StartDir:String
 
-Const TestArgs:="mx2cc makemods"
+Const TestArgs:="mx2cc makemods -target=ios"
 
 'Const TestArgs:="mx2cc makedocs mojo"
 'Const TestArgs:="pyro-framework pyro-gui pyro-scenegraph pyro-tiled"
@@ -75,9 +75,15 @@ Function Main()
 	
 	If GetFileType( env )<>FILETYPE_FILE Fail( "Unable to locate mx2cc 'bin' directory" )
 
-	LoadEnv( env )
-	
-	Local args:=AppArgs()
+	CreateDir( "tmp" )
+
+	Local args:String[]
+
+#If __CONFIG__="debug"
+	args=TestArgs.Split( " " )
+#else
+	args=AppArgs()
+#endif
 	
 	If args.Length<2
 
@@ -107,22 +113,27 @@ Function Main()
 		Print "  for makedocs - list of modules, or nothing to make all docs."
 
 #If __DESKTOP_TARGET__
-		CreateDir( "tmp" )
 		system( "g++ --version >tmp/_v.txt" )
 		Print ""
 		Print "Mx2cc g++ version:"
 		Print ""
 		Print LoadString( "tmp/_v.txt" )
 #Endif
-
-#If __CONFIG__="release"
-		exit_(0)
-#Endif
-		args=TestArgs.Split( " " )
-		If args.Length<2 exit_(0)
-		
+		exit_( 0 )
 	Endif
 	
+	For Local i:=0 Until args.Length
+		If args[i]="-target=ios"
+			system( "xcrun --sdk iphoneos --show-sdk-path >tmp/_p.txt" )
+			Local p:=LoadString( "tmp/_p.txt" ).Trim()
+			SetEnv( "MX2_IOS_SDK",p )
+			'Print "MX2_IOS_SDK="+p
+			Exit
+		Endif
+	Next
+	
+	LoadEnv( env )
+	
 	Local ok:=False
 
 	Try