Răsfoiți Sursa

Change bin/env_blah.txt comment handling so env vars can contain apostrophes.

Mark Sibly 7 ani în urmă
părinte
comite
d449590f50
5 a modificat fișierele cu 23 adăugiri și 32 ștergeri
  1. 1 0
      VERSIONS.TXT
  2. 9 20
      bin/env_linux.txt
  3. 7 3
      bin/env_macos.txt
  4. 3 3
      bin/env_windows.txt
  5. 3 6
      src/mx2cc/mx2cc.monkey2

+ 1 - 0
VERSIONS.TXT

@@ -1,6 +1,7 @@
 
 ***** Monkey2 v1.1.09 *****
 
+Comments in bin/env_blah.txt files have changed. Comments must now span a whole line, and must begin with an apostrophe or hash. If you have modified your env files, make sure to remove any 'inline' comments, ie: comments that begin in the middile of a line somewhere. This change allows for apostrophes in env vars.
 
 Added support for gltf2 binary files (ie: .glb files).
 

+ 9 - 20
bin/env_linux.txt

@@ -1,22 +1,10 @@
 
-'Hack: prevent code stripping for reflection based apps.
-'
-MX2_WHOLE_ARCHIVE=0
-
-
-'If you change anything below, you should rebuild all!
-
-
-'***** LINUX TARGET *****
-
-'This will enable g++-6 builds (if g++-6 is installed and it's not already the default).
-'MX2_GCC_SUFFIX=-6
+'***** LINUX DESKTOP TARGET *****
 
 'LD options
 MX2_LD_OPTS_LINUX=
 MX2_LD_OPTS_LINUX_DEBUG=
-MX2_LD_OPTS_LINUX_RELEASE=-g -O3
-'MX2_LD_OPTS_LINUX_RELEASE=-s
+MX2_LD_OPTS_LINUX_RELEASE=-s -O3
 
 'C compiler options
 MX2_CC_OPTS_LINUX=-std=gnu99
@@ -32,13 +20,14 @@ MX2_CPP_OPTS_LINUX_RELEASE=-O3 -DNDEBUG
 '***** EMSCRIPTEN *****
 
 'For emscripten builds, you need emcc, em++ and emar in your PATH.
-'To run emscripten apps, you'll need MonkeyXFree86c in your devtools dir.
+
+'To run emscripten apps you'll need mserver mini-server.
 '
-MX2_MSERVER="${MX2_HOME}/devtools/MonkeyXFree86c/bin/mserver_linux"
+MX2_MSERVER="${MX2_HOME}/devtools/mserver-v86c/mserver_linux"
 
 'LD options
-MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1
-MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-O2
+MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=['Pointer_stringify']
+MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-O2 -s ASSERTIONS=2
 MX2_LD_OPTS_EMSCRIPTEN_RELEASE=-O3
 
 'wasm LD opts for 1.37.22+
@@ -48,11 +37,11 @@ MX2_LD_OPTS_EMSCRIPTEN_WASM=-s BINARYEN=1 -s BINARYEN_TRAP_MODE='allow'
 'MX2_LD_OPTS_EMSCRIPTEN_WASM=-s BINARYEN=1
 
 'C compiler options
-MX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-warn-absolute-paths 
+MX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths
 MX2_CC_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_CC_OPTS_EMSCRIPTEN_RELEASE=-O3 -DNDEBUG
 
 'C++ compiler options
-MX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion
+MX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths
 MX2_CPP_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_CPP_OPTS_EMSCRIPTEN_RELEASE=-O3 -DNDEBUG

+ 7 - 3
bin/env_macos.txt

@@ -34,14 +34,16 @@ EMSCRIPTEN=${HOME}/emsdk/emscripten/1.35.0
 PATH=${HOME}/emsdk:${HOME}/emsdk/clang/e1.35.0_64bit:${HOME}/emsdk/node/0.12.2_64bit/bin:${HOME}/emsdk/emscripten/1.35.0:${PATH}
 
 'El Capitan broke my python...
+'
 PATH=/usr/local/bin:${PATH}
 
-'To run emscripten apps, you'll need MonkeyXFree86c in your devtools dir.
+'To run emscripten apps you'll need the mserver mini-server.
+'
 MX2_MSERVER=open "${MX2_HOME}/devtools/mserver-v86c/mserver_macos.app" --args
 
 'LD options
-MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1
-MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-O2
+MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -s EXTRA_EXPORTED_RUNTIME_METHODS=['Pointer_stringify']
+MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-O2 -s ASSERTIONS=2
 MX2_LD_OPTS_EMSCRIPTEN_RELEASE=-O3
 
 'wasm LD opts for 1.37.22+
@@ -88,6 +90,8 @@ MX2_ANDROID_APP_STL=c++_static
 
 '***** IOS TARGET *****
 
+'This is now set for you by mx2cc.
+'
 'MX2_IOS_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk
 
 MX2_IOS_DEPLOYMENT_TARGET=8.0

+ 3 - 3
bin/env_windows.txt

@@ -119,9 +119,9 @@ MX2_MSVC_LIB_X64=${MX2_MSVC_LIB_X64}${MX2_WINDOWS_KITS_DIR}\Lib\${MX2_WINDOWS_KI
 MX2_MSERVER="${MX2_HOME}\devtools\mserver-v86c\mserver_winnt.exe"
 
 'Linker options
-MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1
-MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-s ASSERTIONS=2
-MX2_LD_OPTS_EMSCRIPTEN_RELEASE=
+MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1 -s EXTRA_EXPORTED_RUNTIME_METHODS="['Pointer_stringify']"
+MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-O2 -s ASSERTIONS=2
+MX2_LD_OPTS_EMSCRIPTEN_RELEASE=-O3
 
 'wasm LD opts for 1.37.22+
 MX2_LD_OPTS_EMSCRIPTEN_WASM=-s BINARYEN=1 -s BINARYEN_TRAP_MODE='allow'

+ 3 - 6
src/mx2cc/mx2cc.monkey2

@@ -612,14 +612,11 @@ Function LoadEnv:Bool( path:String )
 	
 	For Local line:=Eachin stringio.LoadString( path ).Split( "~n" )
 		lineid+=1
-	
-		Local i:=line.Find( "'" )
-		If i<>-1 line=line.Slice( 0,i )
 		
 		line=line.Trim()
-		If Not line Continue
-		
-		i=line.Find( "=" )
+		If Not line Or line.StartsWith( "'" ) Or line.StartsWith( "#" ) Continue
+	
+		Local i:=line.Find( "=" )
 		If i=-1 Fail( "Env config file error at line "+lineid )
 		
 		Local name:=line.Slice( 0,i ).Trim()