boxgaming / gx

GX is a basic game engine... literally. This is a Game(G) Engine(X) built with and for QB64, a QBasic/QuickBASIC IDE and compiler with modern extensions. GX supports basic 2D gaming: platformer, top-down, etc.... you know, classic NES/SNES type games.
MIT License
32 stars 3 forks source link

Build script improvement - find Phoenix Edition #5

Closed vivid-pixel closed 1 year ago

vivid-pixel commented 2 years ago

Here's my modification to also search for QB64PE

gx\mapmaker\build.bat:

@echo off
if exist "%QB64_HOME%\qb64.exe"  (
    echo Using %QB64_HOME%...
    copy %CD%\inform\gx_falcon.h %QB64_HOME%
    "%QB64_HOME%\qb64.exe" -x %CD%\MapMaker.bas -o %CD%\MapMaker.exe
) else (
    if exist "%QB64_HOME%\qb64pe.exe" (
    echo Using %QB64_HOME%...
    copy %CD%\inform\gx_falcon.h %QB64_HOME%
    "%QB64_HOME%\qb64pe.exe" -x %CD%\MapMaker.bas -o %CD%\MapMaker.exe
  ) else (
    echo QB64 not found at [%QB64_HOME%].
    echo Please ensure the QB64_HOME variable is set to the correct path.
  )
)

There we go, easy compatibility!

Another snag I had during the install was setting the QB64_HOME variable. Under Windows PowerShell on Windows 11, I had to set the variable inside the main build script, rather than in the terminal prior to running. Otherwise the variable was always blank when the script accessed it. Maybe just something I'm doing wrong. gx\build.bat:

set QB64_HOME="C:\Users\admin\OneDrive\Documents\qb64pe\"
cd mapmaker
call build
cd ..
cd tools
call build
cd ..
boxgaming commented 2 years ago

Thanks for the suggestion. I'll incorporate more flexibility in the build script to account for multiple QB64 forks in the next release.

Regarding the QB64_HOME variable. I would recommend setting this as an environment variable so you do not have to set it each time you want to run the build:

https://thegeekpage.com/environment-variables-in-windows-11

boxgaming commented 1 year ago

I forgot to update this issue when I put out the 0.5.0 release. You can now use the build scripts with QB64 or QB64PE.