Yet another build and package system. :)
If your project contains only C/C++ source code, Coddle will discover and install dependencies automatically. No config file or Makefile required.
Create source files (for example, src1.cpp
, src2.cpp
, header1.hpp
, header2.hpp
) in
your project directory (for example, prj/
). Then run:
$ coddle
The build system automatically figures out how to build a binary from your source code. No configuration file is required.
Targets: Windows, Linux, macOS, and iOS (Android maybe).
Coddle currently supports Clang only.
- A supported computer/OS
- git
- clang
- Internet access (to fetch dependencies)
- See above
- Homebrew if you use pkg-config
- MSYS2
$ git clone https://github.com/coddle-cpp/coddle.git && cd coddle && ./build.sh && sudo ./deploy.sh; cd ..
$ git clone https://github.com/coddle-cpp/coddle.git && cd coddle && ./win_build_deploy.sh; cd ..
Sometimes you will want a configuration file.
The config file is coddle.toml
.
The name of your binary or library.
Default: the name of the current directory.
Example:
target="my_new_project"
The Git URL of the package repository.
Default: https://github.com/coddle-cpp/coddle-repository.git
Example:
remoteRepository="https://github.com/coddle-cpp/coddle-repository.git"
Git branch or tag for the package repository.
Default: master
; win
for Windows and macosx
for macOS.
Example:
remoteVersion="master"
Path to a local repository. Values from the local repository override values from the remote repository.
Default: empty string.
Example:
localRepository="../coddle-repository"
Path to the directory containing source files.
Default: .
(current directory).
Example:
srcDir="src"
Path where Coddle should place the binary.
Default: .
(current directory).
Example:
targetDir="bin"
Path where Coddle should put build artifacts.
Default: .coddle
Example:
artifactsDir="build"
Controls optimization level and debug symbols. If debug
is set, optimization is
disabled and symbols are included in the binary.
Default: false
Example:
debug=true
You can also set debug from the command line:
coddle debug
Specifies whether your project uses threads.
Default: false
This is not detected automatically.
Example:
multithreaded=true
Specifies whether your project is a Windows GUI application.
Default: false
Example:
winmain=true
If true
, produces a shared library instead of a static one.
Default: false
Example:
shared=true
Override C compiler.
Default: clang
Example:
cc="clang"
Override C++ compiler.
Default: clang++
Example:
cxx="clang++"
Specifies whether Coddle should add -march=native
to the
compiler flags.
Default: true
Example:
marchNative=false
Your repository should have a libraries.toml
file. The file is a list of libraries.
Example entry:
[[library]]
type="git"
name="cpptoml"
path="https://github.com/skystrife/cpptoml.git"
includes=["cpptoml.h"]
incdir="include"
incdirs=["include1", "include2"]
Library type. Possible values: git
, pkgconfig
, lib
.
Example:
type="lib"
Name of the library.
For pkgconfig
, the name must match the pkg-config package name.
Example:
name="cpptoml"
Path to the library. It might be a Git URL or a filesystem path.
Example:
path="https://github.com/skystrife/cpptoml.git"
Only for git
type: branch or tag.
Default: master
Example:
version="1.0.1"
One-line bash script to run after cloning the Git repository.
Coddle detects dependencies automatically based on files included in
your sources. The includes
array maps header names to dependent libraries.
Example:
includes=["cpptoml.h"]
The directory (or directories) where the library's header files are located.
Example:
incdir="include"
The directory where the library file is located (-L
link option).
Example:
libdir="libs"
Q: I just created a new source file gameplay.cpp
. Do I need to edit some .toml
, .json
, or .ini
file?
A: Nope. Just run:
coddle
Coddle will sniff it out and build it. Like a truffle pig, but for code. đˇ
Q: How do I tell it to build? Do I need --build
, --compile
, --make-it-go-fast
or something?
A: No. Just run:
coddle
Thatâs it. The command you canât forget.
Q: I want to add a library like SDL2. Do I need to configure a bunch of include paths?
A: Nope. Just put this in your code:
#include <SDL.h>
Then run:
coddle
Coddle will fetch it for you. (Itâs clingy like that.)
Q: I donât trust this âautomaticâ thing. I want a clean build from scratch.
A: Usually, just run:
coddle
Coddle will rebuild whatâs needed. Only if you think the build artifacts are corrupted should you drop the hammer:
rm -rf .coddle
Thatâs the nuclear option. â˘ď¸
Q: How do I make a debug build?
A: Just run:
coddle debug
Debugging has never been so⌠undramatic.
Q: How do I run the built app with Coddle? I tried coddle --run
or coddle run
, but that doesnât work.
A: Because Coddle builds, it doesnât babysit. Once built, just run:
./your-app
Coddle trusts you to press Enter on your own.
Q: How do I make the build use multiple CPU cores? Do I need the -j
flag?
A: You already know the answer:
coddle
Itâll use all your cores without asking. đĽď¸đ¨