adding cc option

Monkey Targets Forums/Desktop/adding cc option

Emil_halim(Posted 2014) [#1]
Hi all

this #CC_OPTS will add option to g++ command options for stdcpp target.

so how can i apply that for desktop target ?


Emil_halim(Posted 2014) [#2]
hay ... any body here........!!!!!!!!!!!


AdamRedwoods(Posted 2014) [#3]
so how can i apply that for desktop target ?

you would have to modify and rebuild the transcc program.

src/transcc/builders/glfw

it's too bad it's not standard for all the desktop targets. i'd like to see this in there as well.


Emil_halim(Posted 2014) [#4]
done , thanks AdamRedwoods

here is the modified code ,it so simple see the line i have inserted
	'***** GCC *****
	Method MakeGcc:Void()
	
		Local dst:="gcc_"+HostOS
		
		CreateDir dst+"/"+casedConfig
		CreateDir dst+"/"+casedConfig+"/internal"
		CreateDir dst+"/"+casedConfig+"/external"
		
		CreateDataDir dst+"/"+casedConfig+"/data"
		
		Local main:=LoadString( "main.cpp" )
		
		main=ReplaceBlock( main,"TRANSCODE",transCode )
		main=ReplaceBlock( main,"CONFIG",Config() )
		
		SaveString main,"main.cpp"
		
		If tcc.opt_build
            
			ChangeDir dst
			CreateDir "build"
			CreateDir "build/"+ENV_CONFIG
	
			Local ccopts:="-Wno-free-nonheap-object"	'Grrr....
			Select ENV_CONFIG
			Case "release"
				ccopts+=" -O3 -DNDEBUG"
			End
			'*****************************************************************************
			ccopts += " " +GetConfigVar( "CC_OPTS" )  ' this is what i inserted
                        '******************************************************************************
			Local cmd:="make"
			If HostOS="winnt" And FileType( tcc.MINGW_PATH+"/bin/mingw32-make.exe" ) cmd="mingw32-make"
			
			Execute cmd+" CCOPTS=~q"+ccopts+"~q CCLIBS=~q"+CC_Libs+"~q OUT=~q"+casedConfig+"/MonkeyGame~q"
			
			If tcc.opt_run

				ChangeDir casedConfig

				If HostOS="winnt"
					Execute "MonkeyGame"
				Else
					Execute "./MonkeyGame"
				Endif
			Endif
		Endif
			
	End