add build script

This commit is contained in:
NishiOwO 2025-03-30 11:00:46 +09:00
parent a14507b774
commit 141a804039
No known key found for this signature in database
GPG Key ID: 27EF69B208EB9343
4 changed files with 67 additions and 21 deletions

View File

@ -17,9 +17,6 @@ jobs:
build-win32:
name: "Build for Windows 32-bit"
runs-on: ubuntu-latest
env:
ARCH: i686
BITS: 32
permissions:
contents: write
@ -29,21 +26,5 @@ jobs:
uses: actions/checkout@v4
- name: Install packages
run: sudo apt-get install mingw-w64
- name: Get my CMake files
run: git clone https://github.com/nishiowo/cmake cmake-files --depth=1
- name: Get and extract ODE
run: wget https://sourceforge.net/projects/opende/files/ODE/0.13/ode-0.13.tar.gz/download -O - | tar xvzf -
- name: Build ODE
run: cd ode-0.13 && ./configure --host=${{env.ARCH}}-w64-mingw32 --prefix=/ --disable-demos --without-drawstuff --enable-shared && make -j4
- name: Install ODE
run: make -C ode-0.13 install DESTDIR=`pwd`/deps
- name: Get Pawn
run: git clone https://github.com/nishiowo/pawn --depth=1
- name: Build Pawn
run: cd pawn && mkdir build && cd build && cmake -DDEBIAN=ON -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/windows.cmake -DARCH=${{env.ARCH}} .. -DCMAKE_INSTALL_PREFIX=/ && make -j4
- name: Install Pawn
run: make -C pawn/build install DESTDIR=`pwd`/deps
- name: Build NishBox
run: make PLATFORM=win${{env.BITS}}
- name: Copy DLL
run: cp `make PLATFORM=win${{env.BITS}} print-deps` ./
- name: Run build script
run: env ARCH=i686 BITS=32 MAKE=make ./build-windows.sh

2
.gitignore vendored
View File

@ -3,4 +3,6 @@
*.a
*.core
*.dll
/deps
/contrib
/src/nishbox

62
build-windows.sh Executable file
View File

@ -0,0 +1,62 @@
#!/bin/sh
ODE_VERSION=0.13
BASE=`pwd`
mkdir -p contrib
cd contrib
if [ -d cmake-files ]; then
cd cmake-files
git pull
cd ..
else
git clone https://github.com/nishiowo/cmake cmake-files --depth=1
fi
if [ ! -d ode-${ODE_VERSION} ]; then
wget https://sourceforge.net/projects/opende/files/ODE/${ODE_VERSION}/ode-${ODE_VERSION}.tar.gz/download -O - | tar xvzf -
fi
cd ode-${ODE_VERSION}
if [ ! -f .configured ]; then
./configure --host=${ARCH}-w64-mingw32 --prefix=/ --disable-demos --without-drawstuff --enable-shared || exit 1
touch .configured
fi
if [ ! -f .made ]; then
${MAKE} -j4 || exit 1
touch .made
fi
if [ ! -f .installed ]; then
${MAKE} install DESTDIR=${BASE}/deps
touch .installed
fi
cd ..
if [ -d pawn ]; then
cd pawn
git pull
cd build
else
git clone https://github.com/nishiowo/pawn --depth=1
cd pawn
mkdir build
cd build
fi
if [ ! -f ../.configured ]; then
cmake -DCMAKE_TOOLCHAIN_FILE=../../cmake-files/windows.cmake -DARCH=${ARCH} .. -DCMAKE_INSTALL_PREFIX=/ || exit 1
touch ../.configured
fi
if [ ! -f ../.made ]; then
${MAKE} -j4 || exit 1
touch ../.made
fi
if [ ! -f ../.installed ]; then
${MAKE} install DESTDIR=${BASE}/deps
touch ../.installed
fi
cd ../..
cd ..
${MAKE} PLATFORM=win${BITS}
cp `${MAKE} PLATFORM=win${BITS} print-deps` ./

View File

@ -55,6 +55,7 @@ void nb_draw_init_opengl(nb_draw_t* draw) {
free(font);
}
glBindTexture(GL_TEXTURE_2D, 0);
nb_function_log("Registered %d glyphs", sizeof(nb_font) / sizeof(nb_font[0]));
}
void nb_draw_begin_2d(nb_draw_t* draw) {