mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-10-29 21:12:20 +00:00
Compare commits
3 commits
d93847e6a3
...
35ddfba78a
Author | SHA1 | Date | |
---|---|---|---|
|
35ddfba78a | ||
|
da0423c76d | ||
|
013da78dde |
5 changed files with 96 additions and 22 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
@ -17,9 +17,9 @@ jobs:
|
||||||
|
|
||||||
- name: Build library and examples
|
- name: Build library and examples
|
||||||
run: |
|
run: |
|
||||||
(cd GRRLIB && make clean all install)
|
make -C GRRLIB clean all install
|
||||||
(cd GRRLIB/GRRLIB && make PLATFORM=cube clean all install)
|
make -C GRRLIB/GRRLIB PLATFORM=cube clean all install
|
||||||
(cd examples && make)
|
make -C examples
|
||||||
|
|
||||||
- uses: actions/upload-artifact@master
|
- uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
|
|
2
.github/workflows/doc.yml
vendored
2
.github/workflows/doc.yml
vendored
|
@ -18,7 +18,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install doxygen
|
- name: Install doxygen
|
||||||
run: |
|
run: |
|
||||||
wget https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz -O - | tar -xzv --directory=/tmp/
|
wget https://www.doxygen.nl/files/doxygen-1.12.0.linux.bin.tar.gz -O - | tar -xzv --directory=/tmp/
|
||||||
cd /tmp/doxygen-*
|
cd /tmp/doxygen-*
|
||||||
sudo make install
|
sudo make install
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|
|
@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [Unreleased][]
|
## [Unreleased][]
|
||||||
|
|
||||||
|
- Allow compilation and installation with cmake.
|
||||||
- Added `GRRLIB_CreateEmptyTextureFmt()` to create an empty texture with a given format.
|
- Added `GRRLIB_CreateEmptyTextureFmt()` to create an empty texture with a given format.
|
||||||
|
|
||||||
## [4.5.1][] - 2024-03-02
|
## [4.5.1][] - 2024-03-02
|
||||||
|
|
66
CMakeLists.txt
Normal file
66
CMakeLists.txt
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
cmake_minimum_required(VERSION 3.18)
|
||||||
|
project(grrlib)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
|
||||||
|
pkg_check_modules(PNG REQUIRED libpng)
|
||||||
|
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
||||||
|
pkg_check_modules(JPEG REQUIRED libjpeg)
|
||||||
|
|
||||||
|
add_library(pngu STATIC)
|
||||||
|
|
||||||
|
target_sources(pngu
|
||||||
|
PRIVATE
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/lib/pngu/pngu.c"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(pngu
|
||||||
|
PUBLIC
|
||||||
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/lib/pngu>"
|
||||||
|
PRIVATE
|
||||||
|
${PNG_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(pngu PUBLIC
|
||||||
|
${PNG_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(grrlib STATIC)
|
||||||
|
|
||||||
|
target_compile_options(grrlib
|
||||||
|
PRIVATE
|
||||||
|
-Wall
|
||||||
|
-Wshadow
|
||||||
|
-Wunused
|
||||||
|
)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE GRRLIB_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB/*.c")
|
||||||
|
target_sources(grrlib
|
||||||
|
PRIVATE
|
||||||
|
"${GRRLIB_SRC_FILES}"
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(grrlib
|
||||||
|
PUBLIC
|
||||||
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB>"
|
||||||
|
PRIVATE
|
||||||
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB/grrlib>"
|
||||||
|
${FREETYPE_INCLUDE_DIRS}
|
||||||
|
${JPEG_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(grrlib PUBLIC
|
||||||
|
pngu
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/GRRLIB/GRRLIB/"
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
FILES_MATCHING PATTERN "*.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
install(TARGETS pngu grrlib
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
)
|
43
README.md
43
README.md
|
@ -82,14 +82,31 @@ libjpeg is supplied via devkitPro pacman (ppc-libjpeg-turbo)
|
||||||
libfat is supplied via devkitPro pacman (libfat-ogc)
|
libfat is supplied via devkitPro pacman (libfat-ogc)
|
||||||
```
|
```
|
||||||
|
|
||||||
The easy way is to install GRRLIB and all the required libraries with a few
|
First, you need to make sure that all required library dependencies are installed.
|
||||||
commands:
|
Install them with a single command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pacman --sync --needed --noconfirm libfat-ogc ppc-libpng ppc-freetype ppc-libjpeg-turbo
|
||||||
|
```
|
||||||
|
|
||||||
|
Go to the directory where the code was downloaded:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
c:
|
c:
|
||||||
cd \grr\GRRLIB
|
cd \grr
|
||||||
pacman --sync --needed --noconfirm libfat-ogc ppc-libpng ppc-freetype ppc-libjpeg-turbo
|
```
|
||||||
make clean all install
|
|
||||||
|
To install GRRLIB with Make in a single command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make -C GRRLIB clean all install
|
||||||
|
```
|
||||||
|
|
||||||
|
If you prefer to use CMake, it can also be installed with a few commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/opt/devkitpro/portlibs/wii/bin/powerpc-eabi-cmake -B build
|
||||||
|
cmake --build build --target install
|
||||||
```
|
```
|
||||||
|
|
||||||
This process may take some time depending on the speed of your PC.
|
This process may take some time depending on the speed of your PC.
|
||||||
|
@ -97,36 +114,26 @@ This process may take some time depending on the speed of your PC.
|
||||||
If you used the method above the following steps are not required, GRRLIB is
|
If you used the method above the following steps are not required, GRRLIB is
|
||||||
installed and you are ready to start developing Wii homebrew games.
|
installed and you are ready to start developing Wii homebrew games.
|
||||||
|
|
||||||
If you want, you could install the libfat, libpng,
|
|
||||||
libfreetype and libjpeg with there dependencies in a single command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pacman --sync --needed --noconfirm libfat-ogc ppc-libpng ppc-freetype ppc-libjpeg-turbo
|
|
||||||
```
|
|
||||||
|
|
||||||
Each library could also be installed individually:
|
Each library could also be installed individually:
|
||||||
|
|
||||||
To install libpngu:
|
To install libpngu:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
c:
|
cd GRRLIB\lib\pngu
|
||||||
cd \grr\GRRLIB\lib\pngu
|
|
||||||
make clean all install
|
make clean all install
|
||||||
```
|
```
|
||||||
|
|
||||||
To install libgrrlib for Wii:
|
To install libgrrlib for Wii:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
c:
|
cd GRRLIB\GRRLIB
|
||||||
cd \grr\GRRLIB\GRRLIB
|
|
||||||
make clean all install
|
make clean all install
|
||||||
```
|
```
|
||||||
|
|
||||||
To install libgrrlib for GameCube:
|
To install libgrrlib for GameCube:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
c:
|
cd GRRLIB\GRRLIB
|
||||||
cd \grr\GRRLIB\GRRLIB
|
|
||||||
make PLATFORM=cube clean all install
|
make PLATFORM=cube clean all install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue