Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/compiler/fb.bas
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ sub fbGlobalInit()
env.clopt.stacksize = FB_DEFSTACKSIZE
env.clopt.objinfo = TRUE
env.clopt.showincludes = FALSE
env.clopt.modeview = FB_DEFAULT_MODEVIEW

hUpdateLangOptions( )
hUpdateTargetOptions( )
Expand Down Expand Up @@ -571,6 +572,8 @@ sub fbSetOption( byval opt as integer, byval value as integer )
env.clopt.objinfo = value
case FB_COMPOPT_SHOWINCLUDES
env.clopt.showincludes = value
case FB_COMPOPT_MODEVIEW
env.clopt.modeview = value
end select
end sub

Expand Down Expand Up @@ -643,6 +646,8 @@ function fbGetOption( byval opt as integer ) as integer
function = env.clopt.objinfo
case FB_COMPOPT_SHOWINCLUDES
function = env.clopt.showincludes
case FB_COMPOPT_MODEVIEW
function = env.clopt.modeview

case else
function = 0
Expand Down
9 changes: 9 additions & 0 deletions src/compiler/fb.bi
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,18 @@ enum FB_COMPOPT
FB_COMPOPT_STACKSIZE '' integer
FB_COMPOPT_OBJINFO '' boolean: write/read .fbctinf sections etc.?
FB_COMPOPT_SHOWINCLUDES '' boolean: -showincludes
FB_COMPOPT_MODEVIEW ''__FB_GUI__

FB_COMPOPTIONS
end enum

enum FB_MODEVIEW
FB_MODEVIEW_CONSOLE = 0
FB_MODEVIEW_GUI
end enum

const FB_DEFAULT_MODEVIEW = FB_MODEVIEW_CONSOLE

'' pedantic checks
enum FB_PDCHECK
FB_PDCHECK_NONE = &h00000000
Expand Down Expand Up @@ -265,6 +273,7 @@ type FBCMMLINEOPT
stacksize as integer
objinfo as integer
showincludes as integer
modeview as FB_MODEVIEW
end type

'' features allowed in the selected language
Expand Down
7 changes: 5 additions & 2 deletions src/compiler/fbc.bas
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ private function hLinkFiles( ) as integer
ldcline += hFindLib( "crtend.o" )

end select

if( fbGetOption( FB_COMPOPT_TARGET ) = FB_COMPTARGET_DARWIN ) then
ldcline += " -macosx_version_min 10.6"
end if
Expand Down Expand Up @@ -1755,6 +1755,9 @@ private sub handleOpt(byval optid as integer, byref arg as string)

case OPT_S
fbc.subsystem = arg
select case( arg )
case "gui" : fbSetOption( FB_COMPOPT_MODEVIEW, FB_MODEVIEW_GUI )
end select

case OPT_SHOWINCLUDES
fbSetOption( FB_COMPOPT_SHOWINCLUDES, TRUE )
Expand Down Expand Up @@ -3203,7 +3206,7 @@ private sub hAddDefaultLibs( )
defined(__FB_NETBSD__)
fbcAddDefLibPath( "/usr/X11R6/lib" )
#endif

#if defined(__FB_DARWIN__) and defined(ENABLE_XQUARTZ)
fbcAddDefLibPAth( "/opt/X11/lib" )
#endif
Expand Down
7 changes: 6 additions & 1 deletion src/compiler/symb-define.bas
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ private function hDefOptGosub_cb ( ) as string
function = str( env.opt.gosub = TRUE )
end function

private function hDefGui_cb ( ) as string
function = str( env.clopt.modeview = FB_MODEVIEW_GUI )
end function

private function hDefOutExe_cb ( ) as string
function = str( env.clopt.outtype = FB_OUTTYPE_EXECUTABLE )
end function
Expand Down Expand Up @@ -208,7 +212,8 @@ dim shared defTb(0 to ...) as SYMBDEF => _
(@"__FB_BACKEND__" , NULL , FB_DEFINE_FLAGS_STR, @hDefBackend_cb ), _
(@"__FB_FPU__" , NULL , FB_DEFINE_FLAGS_STR, @hDefFpu_cb ), _
(@"__FB_FPMODE__" , NULL , FB_DEFINE_FLAGS_STR, @hDefFpmode_cb ), _
(@"__FB_GCC__" , NULL , 0 , @hDefGcc_cb ) _
(@"__FB_GCC__" , NULL , 0 , @hDefGcc_cb ), _
(@"__FB_GUI__" , NULL , 0 , @hDefGui_cb ) _
}

sub symbDefineInit _
Expand Down