[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gambas-bugtracker] Bug #2884: Different behavior of project compiled by Ide and gbc3


http://gambaswiki.org/bugtracker/edit?object=BUG.2884&from=L21haW4-

Comment #2 by Bruce STEERS:

Christof just running gbc3 with no arguments may not be enough depending on the project settings,
It does not take into account settings like "all controls/modules are public" and it does not set the executable flag.
Things like that could make a fatal difference in the code running.

Here is some bash code i made in a script that runs in the project folder, it inspects the projects ".project" file and uses the correct arguments for gbc3.

it checks for all controls/modules public (and handles the argument format for this changed in a gambas version)
it checks "keep debuginfo" and uses the arguments -wax (warnings, compile all, executable)

Maybe this could fix your issue?

Respects

# find what flags to pass gbc3 by reading the .project info
ControlPublic=0
ModulePublic=0
eval $(cat .project|grep Public)

KeepDebugInfo=1
eval $(cat .project|grep KeepDebugInfo)

echo "Compiling gambas executable..."
FLG="-wax"
MODE="-f"
CHK=$(gbc3 --help| grep public-module| awk {'print $1'})
if [[ $CHK != "-f" ]]; then
MODE="-"
fi
if [ $KeepDebugInfo -eq 1 ]; then FLG="$FLG"g; fi
if [ $ControlPublic -eq 1 ]; then FLG="$FLG "$MODE"public-control"; fi
if [ $ModulePublic -eq 1 ]; then FLG="$FLG "$MODE"public-module"; fi

# compile the application
gbc3 $FLG
gba3

Bruce STEERS changed the state of the bug to: Accepted.


----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----