{"id":19313737,"url":"https://github.com/geektree0101/sdlbazelexample","last_synced_at":"2026-03-15T08:09:04.500Z","repository":{"id":141412877,"uuid":"162890638","full_name":"GeekTree0101/SDLBazelExample","owner":"GeekTree0101","description":"SDL Cube Bazel builder example","archived":false,"fork":false,"pushed_at":"2018-12-24T02:22:01.000Z","size":80,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T16:43:08.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeekTree0101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-12-23T12:55:08.000Z","updated_at":"2025-01-27T03:54:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"892594f4-6ff0-4ef5-bb6f-e945dd6d1074","html_url":"https://github.com/GeekTree0101/SDLBazelExample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GeekTree0101/SDLBazelExample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FSDLBazelExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FSDLBazelExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FSDLBazelExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FSDLBazelExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeekTree0101","download_url":"https://codeload.github.com/GeekTree0101/SDLBazelExample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FSDLBazelExample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271411434,"owners_count":24754930,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"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":"2024-11-10T00:40:59.099Z","updated_at":"2026-03-15T08:08:59.427Z","avatar_url":"https://github.com/GeekTree0101.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to make SDL application with Bazel Builder?\r\n\u003cimg src=\"https://github.com/GeekTree0101/SDLBazelExample/blob/master/resource/cube.jpg\" height=300px/\u003e\r\n\r\n## 1. Install Bazel \r\n```sh\r\nbrew tap bazelbuild/tap\r\nbrew tap-pin bazelbuild/tap\r\nbrew install bazelbuild/tap/bazel\r\n```\r\nhttps://docs.bazel.build/versions/master/install-os-x.html\r\n\r\n\r\n## 2. Install SDL\r\n```sh\r\nbrew install sdl2\r\n```\r\n\r\n## 3. Make WORKSPACE for SDL2\r\n```py\r\nnew_local_repository(\r\n    name = \"SDL2\",\r\n    path = \"/usr/local/Cellar/sdl2/2.0.9\", # \u003c----- SDL path\r\n    build_file = \"sdl2.BUILD\" # \u003c------ SDL2 Build script!\r\n)\r\n```\r\n\r\n## 4. Make SDL2 Build script\r\n\r\nsdl2 dir \r\n```sh\r\n/usr/local/Cellar/sdl2/2.0.9\r\n- include \u003c----- @Important\r\n- lib \u003c----- @Important (header files located, SDL/*.h)\r\n- TODO.txt\r\n- INSTALL_RECEIPT.json\r\n- bin\t\r\n- share\r\n- README.text\r\n- COPYING.txt\r\n```\r\n\r\nsdl.BUILD script\r\n```py\r\ncc_library(\r\n    name = \"SDL2\",\r\n    hdrs = glob([\"include/SDL2/*.h\"]), \r\n    linkopts = [\r\n        \"-L /usr/local/Cellar/sdl2/2.0.9/lib -l SDL2-2.0.0\", # (-L lib-dir -l lib-name)\r\n        \"-framework OpenGL\" # (use OpenGL, \u003cSDL2/SDL_opengl.h\u003e)\r\n    ],\r\n    strip_include_prefix = \"include\",\r\n    visibility = [\"//visibility:public\"], # Visibility is important!\r\n)\r\n```\r\n\r\n## 5. Make Build script for application\r\n\r\nCube dir\r\n```sh\r\nCube\r\n- BUILD\r\n- Cube.cpp\r\n- Cube.h\r\n- main.cpp\r\n```\r\n\r\nBUILD script\r\n```py\r\n\r\ncc_library(\r\n    name = \"Lib\",\r\n    srcs = [\"Cube.cpp\"],\r\n    hdrs = [\"Cube.h\"],\r\n    deps = [\"@SDL2//:SDL2\"],  # \u003c----- SDL2 library from sdl2.BUILD script\r\n)\r\n\r\ncc_binary(\r\n    name = \"CubeExample\",\r\n    srcs = [\"main.cpp\"],\r\n    deps = [\":Lib\"] .  # \u003c----- dep cc_library.Lib\r\n)\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektree0101%2Fsdlbazelexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeektree0101%2Fsdlbazelexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektree0101%2Fsdlbazelexample/lists"}