{"id":13727625,"url":"https://github.com/felixjones/gba-toolchain","last_synced_at":"2025-04-09T06:10:40.971Z","repository":{"id":38010212,"uuid":"240962598","full_name":"felixjones/gba-toolchain","owner":"felixjones","description":"CMake based toolchain for GBA homebrew development","archived":false,"fork":false,"pushed_at":"2025-03-03T17:28:23.000Z","size":1076,"stargazers_count":125,"open_issues_count":4,"forks_count":11,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-02T04:07:31.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixjones.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-16T20:41:27.000Z","updated_at":"2025-01-14T21:32:25.000Z","dependencies_parsed_at":"2023-11-19T18:25:14.730Z","dependency_job_id":"f0a0259f-9fcc-4ba5-ae9a-c3e51994c478","html_url":"https://github.com/felixjones/gba-toolchain","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixjones%2Fgba-toolchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixjones%2Fgba-toolchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixjones%2Fgba-toolchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixjones%2Fgba-toolchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixjones","download_url":"https://codeload.github.com/felixjones/gba-toolchain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:00:27.747Z","updated_at":"2025-04-09T06:10:40.952Z","avatar_url":"https://github.com/felixjones.png","language":"CMake","funding_links":[],"categories":["Compilers","编译程序"],"sub_categories":["Other places"],"readme":"# gba-toolchain\n\n# Requirements\n\n* [CMake](https://cmake.org/) (3.18 minimum)\n* Arm compiler toolchain ([Arm GNU Toolchain](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads), [devkitPro](https://devkitpro.org/))\n\n# Basic usage\n\ngba-toolchain provides a CMake toolchain file \"`cmake/gba.toolchain.cmake`\" that sets up compilers \u0026 tools for GBA development.\n\nFor more information on CMake toolchains see: [cmake-toolchains cross-compiling](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling)\n\n## Command line\n\nCMake toolchains can be used with CMake on the command line as such:\n\n```shell\ncmake -S . -B build --toolchain=/path/to/cmake/gba.toolchain.cmake\n```\n\nOr for CMake versions prior to `3.21`:\n\n```shell\ncmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=/path/to/cmake/gba.toolchain.cmake\n```\n\n## CMake presets file\n\nFor more information on CMake presets files see: [cmake-presets configure-preset](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html)\n\nObjects of `configurePresets` has the member `toolchainFile`:\n\n```json\n{\n  \"version\": 3,\n  \"cmakeMinimumRequired\": {\n    \"major\": 3,\n    \"minor\": 21,\n    \"patch\": 0\n  },\n  \"configurePresets\": [\n    {\n      \"name\": \"gba-toolchain\",\n      \"generator\": \"Unix Makefiles\",\n      \"toolchainFile\": \"/path/to/cmake/gba.toolchain.cmake\"\n    }\n  ]\n}\n```\n\n# Example CMakeLists.txt\n\n```cmake\ncmake_minimum_required(VERSION 3.18)\nproject(my_project LANGUAGES C)\n\nadd_executable(my_executable main.c)\n\n# gba-toolchain sets `CMAKE_SYSTEM_NAME` to `AdvancedGameBoy`\nif(CMAKE_SYSTEM_NAME STREQUAL AdvancedGameBoy)\n    find_package(librom REQUIRED) # ROM runtime\n    find_package(libseven REQUIRED) # C development library\n    find_package(agbabi REQUIRED) # Optimized library functions\n\n    target_compile_options(my_executable PRIVATE -mthumb -fconserve-stack -fomit-frame-pointer)\n    target_link_libraries(my_executable PRIVATE librom libseven agbabi)\n    \n    # ROM header info\n    set_target_properties(my_executable PROPERTIES\n        ROM_TITLE \"My Game\"\n        ROM_ID AABE\n        ROM_MAKER CD\n        ROM_VERSION 1\n    )\n\n    # install to .gba\n    install_rom(my_executable)\nendif()\n```\n\n# CMake modules\n\nCMake modules are made available with the `find_package` function.\n\nFor more information on CMake `find_package` see: [cmake-commands find_package](https://cmake.org/cmake/help/latest/command/find_package.html)\n\n| Package       | Module                  | Description                                                                                                                    | Additional CMake functions                                       |\n|---------------|-------------------------|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|\n| librom        | Findlibrom.cmake        | ROM runtime library for standard .gba ROMs                                                                                     |                                                                  |\n| libmultiboot  | Findlibmultiboot.cmake  | Multiboot runtime library for executables transferred via GBA MultiBoot                                                        |                                                                  |\n| gba-hpp       | Findgba-hpp.cmake       | C++20 GBA development library ([more info](https://github.com/felixjones/gba-hpp))                                             |                                                                  |\n| libseven      | Findlibseven.cmake      | Modern C GBA development library from sdk-seven ([more info](https://github.com/LunarLambda/sdk-seven))                        |                                                                  |\n| libgba        | Findlibgba.cmake        | C GBA development library from devkitPro ([more info](https://github.com/devkitPro/libgba))                                    |                                                                  |\n| tonclib       | Findtonclib.cmake       | Classic C GBA development library from Coranac ([more info](https://www.coranac.com/man/tonclib/main.htm))                     |                                                                  |\n| gbfs          | Findgbfs.cmake          | Archive format for the GBA ([more info](https://pineight.com/gba/#gbfs))                                                       | `add_gbfs_archive`                                               |\n| maxmod        | Findmaxmod.cmake        | GBA music and sound solution ([more info](https://maxmod.devkitpro.org/))                                                      | `add_maxmod_soundbank`                                           |\n| superfamiconv | Findsuperfamiconv.cmake | Tile graphics converter ([more info](https://github.com/Optiroc/SuperFamiconv))                                                | `add_superfamiconv_graphics`                                     |\n| agbabi        | Findagbabi.cmake        | Library functions optimized for the GBA ([more info](https://github.com/felixjones/agbabi))                                    |                                                                  |\n| posprintf     | Findposprintf.cmake     | Partial implementation of `sprintf` optimized for the GBA ([more info](http://www.danposluns.com/gbadev/posprintf/index.html)) |                                                                  |\n| grit          | Findgrit.cmake          | Bitmap and Tile graphics converter ([more info](https://www.coranac.com/man/grit/html/grit.htm))                               | `add_grit_bitmap`\u003cbr /\u003e`add_grit_sprite`\u003cbr /\u003e`add_grit_tilemap` |\n| butano        | Findbutano.cmake        | Butano engine ([more info](https://github.com/GValiente/butano))                                                               | `add_butano_assets`                                              |\n| gbt-player    | Findgbt-player.cmake    | Game Boy music player library and converter kit ([more info](https://github.com/AntonioND/gbt-player))                         | `add_gbt_assets`\u003cbr /\u003e`add_gbt_maxmod_assets`                    |                                                      |\n\n**Important**: Some modules may have external dependencies that may require tools to be compiled with a host compiler.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixjones%2Fgba-toolchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixjones%2Fgba-toolchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixjones%2Fgba-toolchain/lists"}