All Projects → STBoyden → Ocean

STBoyden / Ocean

Licence: mit
A C/C++ build system/project manager written in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Ocean

Corrosion
Marrying Rust and CMake - Easy Rust and C/C++ Integration!
Stars: ✭ 106 (-26.39%)
Mutual labels:  cmake, cargo
Rttr
C++ Reflection Library
Stars: ✭ 2,031 (+1310.42%)
Mutual labels:  cmake
Cmake Example
Example project which demonstrates various CMake features.
Stars: ✭ 131 (-9.03%)
Mutual labels:  cmake
Cmakeprotosgrpc
gRPC + protobuf using CMake example
Stars: ✭ 137 (-4.86%)
Mutual labels:  cmake
Gemm hls
Scalable systolic array-based matrix-matrix multiplication implemented in Vivado HLS for Xilinx FPGAs.
Stars: ✭ 134 (-6.94%)
Mutual labels:  cmake
Cargo Edit
A utility for managing cargo dependencies from the command line.
Stars: ✭ 2,095 (+1354.86%)
Mutual labels:  cargo
Limited Systems
Limited Systems
Stars: ✭ 132 (-8.33%)
Mutual labels:  cmake
Minimal cmake example
this tries to be a minimal cmake example, that covers sources resources dependencies and packaging.
Stars: ✭ 142 (-1.39%)
Mutual labels:  cmake
Cargo Ndk
Compile Rust projects against the Android NDK without hassle
Stars: ✭ 141 (-2.08%)
Mutual labels:  cargo
Sdl2 Examples
Examples for getting started with SDL2, for over 12 different programming languages
Stars: ✭ 136 (-5.56%)
Mutual labels:  cmake
Blt
A streamlined CMake build system foundation for developing HPC software
Stars: ✭ 135 (-6.25%)
Mutual labels:  cmake
Stegbrute
Fast Steganography bruteforce tool written in Rust useful for CTF's
Stars: ✭ 134 (-6.94%)
Mutual labels:  cargo
Cmake Avr
cmake toolchain for AVR
Stars: ✭ 137 (-4.86%)
Mutual labels:  cmake
Hlslib
A collection of extensions for Vivado HLS and Intel FPGA OpenCL to improve developer quality of life.
Stars: ✭ 131 (-9.03%)
Mutual labels:  cmake
Reggae
Build system in D, Python, Ruby, Javascript or Lua
Stars: ✭ 141 (-2.08%)
Mutual labels:  cmake
Racecar gazebo
A gazebo-based simulator of the MIT Racecar.
Stars: ✭ 130 (-9.72%)
Mutual labels:  cmake
Cargo Flash
a cargo extension for programming microcontrollers
Stars: ✭ 134 (-6.94%)
Mutual labels:  cargo
Cmake
Common CMake modules
Stars: ✭ 137 (-4.86%)
Mutual labels:  cmake
Huggle3 Qt Lx
Huggle is an anti-vandalism tool for use on MediaWiki based projects
Stars: ✭ 143 (-0.69%)
Mutual labels:  cmake
Multi Rtl
Multi-channel receiver with use of RTL-SDR dongles
Stars: ✭ 142 (-1.39%)
Mutual labels:  cmake

A build system/project manager for C/C++

Disclaimer: this is a personal project that I spend my free time on.

"It's cute" - EntireTwix, 2021

Ocean is a project manager, similar to Rust's Cargo, for C and C++ written with Rust - that other systems programming language. The command syntax is very similar to that of Cargo's.

By default, Ocean will use gcc to compile C and C++ source files, outputting the executables to build/{mode}/{project_name}.

Table of contents

  1. How to install
  2. Requirements
  3. Supported compilers
  4. Features
  5. Command help
  6. FAQ
    1. Are you making a package manager?
    2. How often do you plan on working on Ocean?
    3. Why use this over CMake or Premake?
  7. To Do

Requirements

Supported compilers

Officially supported compilers:

  • GNU C Compiler (GCC)
  • Clang

How to install

  1. Make sure you have Cargo and Rust installed: https://rustup.rs/.
  2. From a command line, enter the following command: cargo install --git https://github.com/STBoyden/ocean.
  3. Done!

Make sure to use ocean --help if you're not sure how to use this application.

Features

  • The ability to build and run your project with a single command.
  • Easy syntax - designed to be similar to Rust's Cargo.
  • Easy setup - all the available options that can be changed in Ocean.toml can also be changed through the commands.
  • Small project preparation time - can get your C/C++ project up and running in only a few seconds (with optional config arguments for multiple editors of your choice).

Command help

Usage: ocean [OPTION]

Create and manage C and C++ projects.

    build           Builds the current project
    clean           Cleans the current project's build artifacts
    get             Returns the values set in the Ocean.toml
    set             Sets the values inside Ocean.toml
    help, --help    Shows this help text
    new             Creates a new C/C++ project in a new directory
    run             Runs the current project, builds if no build is present

build

Usage: ocean build [OPTIONS]

By default, this builds projects in debug mode.

Options:
    -d, --debug     Builds the current project in debug mode (this is turned on by default)
    -r, --release   Builds the current project in release mode
    -v, --verbose   Makes the compiler output verbose.
    -f, --flags     Passes custom flags to the compiler.

get

Usage: ocean get [KEY]

This gets the current values inside the Ocean project file related to a datakey entered by the user.

Option:
    build_dir                       Prints the build directory for the current project.
    c++_compiler, cxx_compiler      Prints the compiler being used for the C++ project.
    c_compiler                      Prints the compiler being used for the C project.
    compiler, current_compiler      Prints the current compiler being used for the project.
    flags                           Prints the flags of the current compiler.
    lang, language                  Prints the current language of the project.
    lib_dirs, library_directories   Prints the library directories that would be searched by the linker.
    libs, libraries                 Prints the libraries being compiled with the project.  
    name                            Prints the name of the project.
    object_dir                      Prints the object output directory.
    source_dir                      Prints the source code directory.

set

Usage: ocean set [KEY]

This set values inside the Ocean project file to a value specified by the user.

Option:
    build_dir [DIRECTORY]                               Sets the build directory for the project.
    c++_compiler [COMPILER], cxx_compiler [COMPILER]    Set the compiler being used for the C++ project.
    c_compiler [COMPILER]                               Sets the compiler being used for the C project.
    compiler [COMPILER], current_compiler [COMPILER]    Sets the current compiler being used for the project.
    flags [FLAGS]                                       Sets the flags of the current compiler, split by commas.
    lang [LANG], language [LANG]                        Set the current language of the project.
    lib_dirs [DIRS], library_directories [DIRS]         Sets the library directories that would be searched by the linker, split by commas.
    libs [LIBS], libraries [LIBS]                       Sets the libraries being compiled with the project, split by commas.
    name [NAME]                                         Sets the name of the project.
    object_dir [DIRECTORY]                              Sets the object output directory.
    source_dir [DIRECTORY]                              Sets the source code directory.

new

Usage: ocean new [NAME] [OPTIONS]

This creates a new project with a generated Ocean.toml in a new directory with a specified NAME.
Options:
    -C                  Creates a new C project (default).
    -CXX                Creates a new C++ project.
    -b, --build-dir     Sets the build directory (default is "./build")
    -s, --source-dir    Sets the source directory (default is "./src")
    -o, --obj-dir       Sets the objects directory (default is "./obj")
    -c, --compiler      Sets the compiler for the current project (default is gcc for C and g++ for C++).
    --ccls              Outputs a .ccls file to be used with ccls. Allows a language server to be used with an editor like Vim, for example.
    --vscode            Outputs Visual Studio Code config files to make writing C/C++ easier.

run

Usage: ocean run [OPTIONS]

By default, this run projects in debug mode.

Options:
    -d, --debug     Runs the current project in debug mode (this is turned on by default)
    -r, --release   Runs the current project in release mode
    -v, --verbose   Makes the compiler output verbose.
    -f, --flags     Passes custom flags to the compiler.

FAQ

Q: Are you making a package manager?

A: Not yet. I am considering making a package manager but I have not decided fully. Either way, this will be decided at a later date.

Q: How often do you plan on working on Ocean?

A: Seeing as this is a personal side project, I will spend time on it when I please but probably quite often. I do have a job so that will take priority.

Q: Why use this over CMake, Premake (etc.)?

A: At least for me personally, using Ocean takes less time to get things set up over something like CMake and Premake. Especially for smaller projects where I just want to prototype something quickly and easily without having to mess around in a CMakeLists.txt. However, Ocean is not a replacement for either CMake or Premake and is not intended to.

To Do

  • [ ] Use cc crate instead of manually calling the compiler commands.
    • Won't work for creating executables but might be able to used for creating libraries.
  • [ ] Use clap or structopt to parse arguments.
  • [ ] Work on incremental builds:
    • Look into Go's build cache.
  • [ ] Provide examples of Ocean usage with varying degree of project size (in progress).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].