{"id":13465090,"url":"https://github.com/STBoyden/ocean","last_synced_at":"2025-03-25T13:32:58.759Z","repository":{"id":54572920,"uuid":"297468754","full_name":"STBoyden/ocean","owner":"STBoyden","description":"A C/C++ build system/project manager written in Rust","archived":false,"fork":false,"pushed_at":"2021-04-18T15:56:23.000Z","size":361,"stargazers_count":154,"open_issues_count":2,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T14:10:28.838Z","etag":null,"topics":["cargo","cmake","ocean","premake","rust-cargo"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/STBoyden.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}},"created_at":"2020-09-21T21:48:18.000Z","updated_at":"2024-05-11T09:43:08.000Z","dependencies_parsed_at":"2022-08-13T20:10:25.957Z","dependency_job_id":null,"html_url":"https://github.com/STBoyden/ocean","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STBoyden%2Focean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STBoyden%2Focean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STBoyden%2Focean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/STBoyden%2Focean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/STBoyden","download_url":"https://codeload.github.com/STBoyden/ocean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245471261,"owners_count":20620907,"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":["cargo","cmake","ocean","premake","rust-cargo"],"created_at":"2024-07-31T14:00:58.668Z","updated_at":"2025-03-25T13:32:58.331Z","avatar_url":"https://github.com/STBoyden.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003cimg src=\"banner.svg\" style=\"display: block; margin: 0 auto; width: 75%;\" /\u003e\n\u003ch4 style=\"text-align: center\"\u003e\u003ci\u003eA build system/project manager for C/C++\u003c/i\u003e\u003c/h4\u003e\n\n\u003ch3 style=\"text-align: center\"\u003e\n    \u003ci\u003e\n        Disclaimer: this is a personal project that I spend my free time on.\n    \u003c/i\u003e\n\u003c/h3\u003e\n\n\u003ch5\u003e\u003ci\u003e\"It's cute\"\u003c/i\u003e - \u003cstrong\u003eEntireTwix, 2021\u003c/strong\u003e\u003ch5\u003e\n\nOcean is a project manager, similar to Rust's Cargo, for C and C++ written with\nRust - *that other systems programming language*. The command syntax is very\nsimilar to that of Cargo's.\n\nBy default, Ocean will use `gcc` to compile C and C++ source files, outputting\nthe executables to `build/{mode}/{project_name}`.\n\n\n## Table of contents\n1. [How to install](#how-to-install)\n1. [Requirements](#requirements)\n1. [Supported compilers](#supported-compilers)\n1. [Features](#features)\n1. [Command help](#command-help)\n    - [`build`](#build)\n    - [`clean`](#clean)\n    - [`get`](#get)\n    - [`set`](#set)\n    - [`new`](#new)\n    - [`run`](#run)\n1. [FAQ](#faq)\n    1. [Are you making a package\n       manager?](#q-are-you-making-a-package-manager)\n    1. [How often do you plan on working on\n       Ocean?](#q-how-often-do-you-plan-on-working-on-ocean)\n    1. [Why use this over CMake or\n       Premake?](#q-why-use-this-over-cmake-premake-etc)\n1. [To Do](#to-do)\n\n## Requirements\n- `rustc \u003e= 1.46.0`\n- One of the [supported compilers](#supported-compilers)\n\n## Supported compilers\nOfficially supported compilers:\n\n- GNU C Compiler (GCC)\n- Clang\n\n## How to install\n\n1) Make sure you have Cargo and Rust installed: https://rustup.rs/.\n2) From a command line, enter the following command: `cargo install --git\nhttps://github.com/STBoyden/ocean`.\n3) Done!\n\nMake sure to use `ocean --help` if you're not sure how to use this application.\n\n## Features\n- The ability to build and run your project with a single command.\n- Easy syntax - designed to be similar to Rust's Cargo.\n- Easy setup - all the available options that can be changed in Ocean.toml can\n  also be changed through the commands.\n- Small project preparation time - can get your C/C++ project up and running in\n  only a few seconds (with optional config arguments for multiple editors of your choice).\n\n## Command help\n```\nUsage: ocean [OPTION]\n\nCreate and manage C and C++ projects.\n\n    build           Builds the current project\n    clean           Cleans the current project's build artifacts\n    get             Returns the values set in the Ocean.toml\n    set             Sets the values inside Ocean.toml\n    help, --help    Shows this help text\n    new             Creates a new C/C++ project in a new directory\n    run             Runs the current project, builds if no build is present\n```\n\n#### `build`\n```\nUsage: ocean build [OPTIONS]\n\nBy default, this builds projects in debug mode.\n\nOptions:\n    -d, --debug     Builds the current project in debug mode (this is turned on by default)\n    -r, --release   Builds the current project in release mode\n    -v, --verbose   Makes the compiler output verbose.\n    -f, --flags     Passes custom flags to the compiler.\n```\n\n#### `get`\n```\nUsage: ocean get [KEY]\n\nThis gets the current values inside the Ocean project file related to a datakey entered by the user.\n\nOption:\n    build_dir                       Prints the build directory for the current project.\n    c++_compiler, cxx_compiler      Prints the compiler being used for the C++ project.\n    c_compiler                      Prints the compiler being used for the C project.\n    compiler, current_compiler      Prints the current compiler being used for the project.\n    flags                           Prints the flags of the current compiler.\n    lang, language                  Prints the current language of the project.\n    lib_dirs, library_directories   Prints the library directories that would be searched by the linker.\n    libs, libraries                 Prints the libraries being compiled with the project.  \n    name                            Prints the name of the project.\n    object_dir                      Prints the object output directory.\n    source_dir                      Prints the source code directory.\n```\n\n#### `set`\n```\nUsage: ocean set [KEY]\n\nThis set values inside the Ocean project file to a value specified by the user.\n\nOption:\n    build_dir [DIRECTORY]                               Sets the build directory for the project.\n    c++_compiler [COMPILER], cxx_compiler [COMPILER]    Set the compiler being used for the C++ project.\n    c_compiler [COMPILER]                               Sets the compiler being used for the C project.\n    compiler [COMPILER], current_compiler [COMPILER]    Sets the current compiler being used for the project.\n    flags [FLAGS]                                       Sets the flags of the current compiler, split by commas.\n    lang [LANG], language [LANG]                        Set the current language of the project.\n    lib_dirs [DIRS], library_directories [DIRS]         Sets the library directories that would be searched by the linker, split by commas.\n    libs [LIBS], libraries [LIBS]                       Sets the libraries being compiled with the project, split by commas.\n    name [NAME]                                         Sets the name of the project.\n    object_dir [DIRECTORY]                              Sets the object output directory.\n    source_dir [DIRECTORY]                              Sets the source code directory.\n```\n\n#### `new`\n```\nUsage: ocean new [NAME] [OPTIONS]\n\nThis creates a new project with a generated Ocean.toml in a new directory with a specified NAME.\nOptions:\n    -C                  Creates a new C project (default).\n    -CXX                Creates a new C++ project.\n    -b, --build-dir     Sets the build directory (default is \"./build\")\n    -s, --source-dir    Sets the source directory (default is \"./src\")\n    -o, --obj-dir       Sets the objects directory (default is \"./obj\")\n    -c, --compiler      Sets the compiler for the current project (default is gcc for C and g++ for C++).\n    --ccls              Outputs a .ccls file to be used with ccls. Allows a language server to be used with an editor like Vim, for example.\n    --vscode            Outputs Visual Studio Code config files to make writing C/C++ easier.\n```\n\n#### `run`\n```\nUsage: ocean run [OPTIONS]\n\nBy default, this run projects in debug mode.\n\nOptions:\n    -d, --debug     Runs the current project in debug mode (this is turned on by default)\n    -r, --release   Runs the current project in release mode\n    -v, --verbose   Makes the compiler output verbose.\n    -f, --flags     Passes custom flags to the compiler.\n```\n\n\n## FAQ\n\n#### Q: Are you making a package manager?\nA: Not *yet*. I am considering making a package manager but I have not decided\nfully. Either way, this will be decided at  a later date.\n\n#### Q: How often do you plan on working on Ocean?\nA: Seeing as this is a personal side project, I will spend time on it when I\nplease but probably quite often. I do have a job so that will take priority.\n\n#### Q: Why use this over CMake, Premake (etc.)?\nA: At least for me personally, using Ocean takes less time to get things set up\nover something like CMake and Premake. Especially for smaller projects where I\njust want to prototype something quickly and easily without having to mess\naround in a CMakeLists.txt. However, Ocean is **not** a replacement for either\nCMake or Premake and is not intended to.\n\n## To Do\n\n- [ ] Use `cc` crate instead of manually calling the compiler commands.\n    - Won't work for creating executables but might be able to used for creating libraries.\n- [ ] Use `clap` or `structopt` to parse arguments.\n- [ ] Work on incremental builds:\n    - Look into Go's build cache.\n- [ ] Provide examples of Ocean usage with varying degree of project size (in progress).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSTBoyden%2Focean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSTBoyden%2Focean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSTBoyden%2Focean/lists"}