A fast, minimal low-level build system with intelligent target management
- Optimization - Introduce parallel processing to many functions.
- Enhanced execution pipeline - Safer and faster execution.
- Added target types - Extend capability for future upgrades.
- Refactored codebase - A Cleaner, more efficient codebase.
- Added new fields in user configuration - Adapting new changes.
- Install targets safer - Smarter installation.
- π― Incremental Builds - For lightning fast rebuilds
- β‘ Parallel Compilation - Multi-threaded compilation by default
- πͺ Multi-Target Support - Build multiple targets from a single project with target-specific configurations
- β Multi-Target Type - Build multiple executable/dynamic libraries/static libraries from a single file;
- π§ Smart Auto-detection - Automatically discovers local headers, system libraries, and build targets
- π Extensible Knowledge Base - Uses JSON database for library detection rules that update without recompilation
- π§ Pre-Compiled Headers - Automatically generates PCH for common headers to speed up compilation
- π― Target Discovery - Intelligently discovers main() functions and suggests build targets
- π€ Automated setup - with
autoconfig
setting up a project becomes easy - β
TUI-Based selector - using
edit
to edit configuration files without any external edtior
cmake >= 3.30
C++23 standard support
fmt library
xxhash library
OpenSSL library
git
# Clone the repository
git clone https://github.com/assembler-0/autocc.git
cd autocc
# Build with cmake
mkdir build && cd build
cmake .. && make # -DWALL=ON for all possible warnings -DARM=ON for no optimization -DNUSE_TUI=ON for disabling ftxui
# Or if you already have autocc:
autocc setup && autocc
# to install _autocc completetion for zsh, in the project ROOT, run:
chmod + x ./zsh/install.sh && ./zsh/install.sh
# to uninstall
chmod + x ./zsh/install.sh && ./zsh/uninstall.sh
target_compile_definitions(autocc PUBLIC
# -DLOG_DISABLE -- disable logging
# -DLOG_DISABLE_INFO -- disable info
# -DLOG_DISABLE_COLORS -- disable colors
-DLOG_ENABLE_FILE # -- enable file logging
# -DLOG_DISABLE_TIMESTAMP -- disable timestamps
# -DVERBOSE -- enable verbose logging
)
# Generate config with intelligent target discovery
autocc autoconfig # or 'autocc ac', use --default to skip all and use builtin configuration
# This will:
# - Scan your project for main() functions
# - Suggest build targets automatically
# - Detect headers and libraries
# - Create autocc.toml with smart defaults
autocc edit # or 'autocc select'
# this edits sources to build
autocc setup # or 'autocc sync' or 'autocc sc'
# Converts autocc.toml to internal build cache
# Build default target
autocc
# Build specific target
autocc my_target
# Build with target name
autocc test_suite
# install default target (may need root privileges)
autocc install # for default target
# install specific target
autocc install my_target
# install all targets
autocc install <target> --prefix=<path to install> # to install to a specific path
# AUTOCC 0.1.6
# CONFIGURATION FILE 'autocc.toml' IS WRITTEN BY AUTOCC 0.1.6, MAKE SURE YOU HAVE AN APPROPRIATE AUTOCC BUILD.
# COPYRIGHT (C) assembler-0 2025
[compilers]
ar = 'ar' # your archiver
as = 'nasm' # your assembler
cc = 'clang' # your C compiler
cxx = 'clang++' # your C++ compiler
launcher = 'ccache' # your launcer
sl = 'clang++' # your dynamic linker
[features]
use_pch = true # use precompiled header
[paths]
exclude_patterns = [] # global exclude pattern
include_dirs = [ 'include', '.', 'include/imgui', 'include/imgui/backends' ] # global include directories
[project]
build_dir = '.autocc_build' # project build directory
default_target = 'sift' # default target
[[targets]]
cflags = '-std=c11' # cflags
cxxflags = '-std=c++23' # c++ flags
exclude_patterns = [] # target exclude patten
external_libs = [ '-ldl', '-lz', '-llzma', '-lpthread', '-lm', '-lglfw', '-lGL' ] # external library
ldflags = '' # Linker flags
main_file = './src/main.cpp' # main file
name = 'main' # target name
output_name = 'main' # target output name
sources = [
'./asm/3np1.asm',
'./asm/aesDEC.asm',
'./asm/aesENC.asm',
'./asm/avx.asm',
'./asm/branch.asm',
# snip...
'./src/lzma.module.cpp',
'./src/main.cpp',
'./src/systemMonitor.manage.cpp'
]
type = 'SLibrary' # Or 'Executable' 'SLibrary' 'DLlibrary'
AutoCC 0.1.6-2 compiled on Aug 5 2025 at 13:14:43
Usage: autocc [command] (target_name)
Commands:
<none> or <target> Builds the default target, or a specified target.
ac/autoconfig Creates 'autocc.toml' via an interactive prompt.
setup/sync/sc Converts 'autocc.toml' to the internal build cache.
edit/select Open a TUI to visually select source files for targets (could be disabled).
clean Removes the build directory.
wipe Removes all autocc generated files (cache, build dir, db).
fetch Download/update the library detection database.
version Show current version and build date.
help Shows this help message.
install <target> Install specified target to system binary dir.
Flags:
--default For 'autocc autoconfig', use default settings.
--prefix For 'autocc install', install to a specific path.
AutoCC's target system allows you to build multiple executables from a single project:
- Main Detection: Scans for
main()
functions automatically - Pattern Recognition: Identifies test files, benchmark files, etc.
- Smart Suggestions: Recommends source files for each target
- Interactive Setup: Guides you through target configuration
- Isolated Builds: Each target compiles only its specified sources
- Custom Output Names: Different executable names per target
- Target-Specific Excludes: Fine-grained control over what gets compiled
- Default Target: Set which target builds with just
autocc
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and test thoroughly
- Ensure all targets build:
autocc test && autocc benchmark
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to your branch:
git push origin feature/amazing-feature
- Open a Pull Request
autocc/
βββ zsh/
β βββ install.sh # Install script for _autocc
β βββ uninstall.sh # Uninstall script for _autocc
β βββ _autocc # auto suggestions for zsh
βββ include/
β βββ httplib.h # http for downloading
β βββ json.hpp # json for caching and db
β βββ toml.hpp # toml for config
β βββ utils.hpp # Utility functions
β βββ log.hpp # Logging system
βββ autocc.cc # autocc main C++ file
βββ autocc.base.json # Library detection database
βββ pvs.sh # Shell script for PVS-Studio static analyzer
βββ autocc.toml # Autocc configuration
βββ CMakeLists.txt # CMake configuration
βββ ... # Misc. files
This project is licensed under the MIT License β see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
β Star this project if you find it helpful!