{"id":34624553,"url":"https://github.com/dankmeme01/geobuild","last_synced_at":"2026-05-29T09:31:44.137Z","repository":{"id":323247262,"uuid":"1091200593","full_name":"dankmeme01/geobuild","owner":"dankmeme01","description":"Build system extension for Geode mods written in Python","archived":false,"fork":false,"pushed_at":"2026-02-11T15:59:15.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-12T00:32:56.825Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dankmeme01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-06T17:33:00.000Z","updated_at":"2026-02-11T15:59:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dankmeme01/geobuild","commit_stats":null,"previous_names":["dankmeme01/geobuild"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dankmeme01/geobuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankmeme01%2Fgeobuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankmeme01%2Fgeobuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankmeme01%2Fgeobuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankmeme01%2Fgeobuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dankmeme01","download_url":"https://codeload.github.com/dankmeme01/geobuild/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dankmeme01%2Fgeobuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33646421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-12-24T15:46:45.692Z","updated_at":"2026-05-29T09:31:44.132Z","avatar_url":"https://github.com/dankmeme01.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Geobuild\n\nGeobuild is a build system extension for [Geode](https://github.com/geode-sdk/geode) mods written in Python, allowing you to write configuration for your mod in that language as well.\n\n## Why?\n\nBeginners find CMake confusing and complicated. Experts find CMake even more confusing and complicated. Geobuild makes it possible to move most of your CMake configuration into a single Python file, making it easier to write and maintain. No need to deal with horrors of downloading files, parsing JSON or doing math expressions in CMake: simply do it all in Python!\n\nBesides just making it simpler to write build configuration, Geobuild has some other features that make developing Geode mods a much nicer experience:\n\n* Reduced CMakeLists.txt clutter\n* Automatic checking for updates of Geode/CMake dependencies (disabled by default)\n* Ability to generate the mod.json from a template and add custom things to it\n* Allow you to run *whatever you want*. Whether it is generating some build configuration files, downloading binaries, this is not CMake so you are only limited by your imagination and PyPI :)\n\n## Usage\n\nConverting your mod to Geobuild is pretty simple if you don't do much advanced logic in your CMake file. For example, here's a complete [example mod CMakeLists.txt](https://github.com/geode-sdk/example-mod/blob/minimal/CMakeLists.txt) rewritten to use Geobuild:\n\n```cmake\ncmake_minimum_required(VERSION 3.21)\nset(CMAKE_CXX_STANDARD 20)\nset(CMAKE_CXX_STANDARD_REQUIRED ON)\nif (\"${CMAKE_SYSTEM_NAME}\" STREQUAL \"iOS\" OR IOS)\n    set(CMAKE_OSX_ARCHITECTURES \"arm64\")\nelse()\n    set(CMAKE_OSX_ARCHITECTURES \"arm64;x86_64\")\nendif()\nset(CMAKE_CXX_VISIBILITY_PRESET hidden)\n\nproject(Template VERSION 1.0.0)\n\nif (NOT DEFINED ENV{GEODE_SDK})\n    message(FATAL_ERROR \"Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode\")\nelse()\n    message(STATUS \"Found Geode: $ENV{GEODE_SDK}\")\nendif()\n\nadd_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)\n\nCPMAddPackage(\"gh:dankmeme01/geobuild#main\")\ninclude(\"${CMAKE_CURRENT_BINARY_DIR}/geobuild-gen.cmake\")\n```\n\nFew notes here:\n\n* You **must** remove the `add_library` and `setup_geode_mod` lines, as well as globbing sources. These parts are handled by Geobuild.\n* Including Geobuild must be after `add_subdirectory` is called with the path to Geode\n\nThis alone will be almost identical to the original example mod CMakeLists. Now, to actually modify the configuration, you will need to create a `geobuild.py` file at the root of your repository. Here's a simple quick start:\n\n```py\n# These lines are optional, but they will provide working Python intellisense,\n# once you build your project at least once.\nfrom typing import TYPE_CHECKING\nif TYPE_CHECKING:\n    from .build.geobuild.prelude import *\n\ndef main(build: Build):\n    build.add_source_dir(\"src/*.cpp\")\n```\n\n## In-depth details\n\nHere are some examples of what you can do with Geobuild:\n\nAdding CMake options (like the `option()` command), setting variables:\n\n```py\n# add LTO on release builds, can be set via `-DRELEASE_BUILD=ON`\nrelease = build.add_option(\"RELEASE_BUILD\")\n# add debug define and stuff\ndebug = build.add_option(\"DEBUG_BUILD\")\n\nif release:\n    build.enable_lto()\n\nif debug:\n    build.add_definition(\"DEBUG_BUILD\", \"1\")\n\nbuild.set_variable(\"GEODE_DISABLE_PRECOMPILED_HEADERS\", \"ON\") # or set_cache_variable\n```\n\nCheck the host/target environment:\n\n```py\nhost = build.config.host_desc()\ntarget = build.platform\n\nif target.is_apple():\n    print(\"Stinky\")\n\nprint(f\"Building on {host} for {target}\")\n\n# Verify the Geode SDK version is new enough\n# This can also be a commit hash, useful if your mod requires nightly\nbuild.verify_sdk_at_least(\"v4.9.0\")\n\n# To manually throw in the towel, simply call fatal_error\nif not build.config.is_clang:\n    fatal_error(\"This mod requires clang to build\")\n```\n\nAdd compile definitions, source dirs, include dirs, compile options, link libraries:\n\n```py\n# Equivalent to target_compile_definitions(${PROJECT_NAME} PRIVATE MY_MACRO=\"123\")\nbuild.add_definition(\"MY_MACRO\", \"\\\"123\\\"\")\n# Privacy and target can be changed\nbuild.add_definition(\"MY_MACRO\", \"\\\"123\\\"\", privacy=Privacy.PUBLIC, target=\"geode\")\n\n# Source dirs may be either a Path or a string,\n# if it doesn't end in a glob expression, multiple extensions will be globbed: .c, .cpp, .m, .mm\nbuild.add_source_dir(\"src/*.cpp\")\nbuild.add_source_dir(build.config.project_dir / \"external\")\nbuild.add_source_file(\"src/main.cpp\")\n\n# Add src/ as an include directory, allowing includes with angled (\u003c...\u003e) brackets\nbuild.add_include_dir(\"src/\")\n\n# Make sure to check the compiler before using compiler options!\nif build.config.compiler_frontend == \"MSVC\":\n    build.add_compile_option(\"/w\")\nelse:\n    build.add_compile_option(\"-Wno-everything\")\n\n# (there is also a shorthand for disabling all warnings on a dependency)\nbuild.silence_warnings_for(\"geode\")\n\n# link_library / link_libraries can be used to link any amount of libraries\nif build.platform == Platform.Windows:\n    build.link_libraries(\"ws2_32\", \"iphlapi\", \"kernel32\")\nelif build.platform.is_android():\n    build.link_library(\"android\")\n```\n\nAdd CPM dependencies:\n```py\n# The gh: part is optional; this also can be a full URL\n# This automatically links to the library as well.\nbuild.add_cpm_dep(\"gh:GlobedGD/argon\", \"v1.2.0\")\n\n# If you want to add options to the library or if the library's target name\n# is different from the repo name, use `link_name` and `options` params\nbuild.add_cpm_dep(\"dankmeme01/qunet-cpp\", \"main\",\n    options={\"QUNET_DEBUG\": debug},\n    link_name=\"qunet\"\n)\n```\n\nAdd geode dependencies and codegen mod.json:\n\n```py\n# This code assumes there's a 'mod.json.template' file in the repository root.\n# It is also possible to pass a dictionary with the contents of the mod JSON.\nbuild.enable_mod_json_generation(\"mod.json.template\")\n\n# As an example, add a dependency only if a certain flag is set.\n# This is something that would be very annoying to do with plain CMake,\n# and Geobuild makes it very simple.\nvar = build.add_option(\"USE_ALPHAS_UTILS\")\nif var:\n    build.add_definition(\"USE_ALPHAS_UTILS\", \"1\")\n    build.add_geode_dep(\"alphalaneous.alphas_geode_utils\", \"\u003e=1.1.8\")\n\n# After Geobuild is done running, a mod.json will be generated in the repo root.\n# Do not commit this! Add it to .gitignore and only commit the template file.\n```\n\nUpdate checks for CPM deps (requires the `requests` module to be installed)\n\n```py\n# You probably shouldn't forcibly do this every reconfiguration, but it is an option.\n# Call this after all CPM dependencies have been added.\nbuild.check_for_updates()\n\n# Instead of manually calling this, you can set either the `GEOBUILD_UPDATE_CHECK` environment variable\n# or the CMake flag `-DGEOBUILD_UPDATE_CHECK` to 'ON', and in that case,\n# Geobuild will automatically check for updates every 24 hours.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankmeme01%2Fgeobuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdankmeme01%2Fgeobuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdankmeme01%2Fgeobuild/lists"}