Skip to content

Commit eb7d84d

Browse files
authored
Merge branch 'main' into dependabot/github_actions/main/github-actions-83e6c7d9ce
2 parents 85563e4 + 1c92d8e commit eb7d84d

File tree

562 files changed

+4794
-3860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

562 files changed

+4794
-3860
lines changed

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
sudo apt-get install cmake xorg-dev curl
2929
3030
- name: Build
31-
run: ./build.sh --jobs 2 --compiler ${{ matrix.config.compiler }}
31+
run: ./build.sh --jobs 4 --compiler ${{ matrix.config.compiler }}
3232

3333
- name: Test
3434
run: ctest

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
cmake ..
2929
3030
- name: Build
31-
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}
31+
run: cmake --build build --parallel 4 --config ${{ matrix.config.build_type }}
3232

3333
- name: Test
3434
run: ctest

.github/workflows/web.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
emcmake cmake ..
3131
3232
- name: Build
33-
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}
33+
run: cmake --build build --parallel 4 --config ${{ matrix.config.build_type }}

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
cmake ..
3434
3535
- name: Build
36-
run: cmake --build build --parallel --config ${{ matrix.config.build_type }}
36+
run: cmake --build build --parallel 4 --config ${{ matrix.config.build_type }}
3737

3838
- name: Test
3939
run: ctest

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2025 Breno Cunha Queiroz
3+
Copyright (c) 2020-2026 Breno Cunha Queiroz
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

build.sh

Lines changed: 61 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
#!/bin/bash
22
set -e
33

4+
# Colors
5+
BOLD="\033[1m"
6+
RESET="\033[0m"
7+
RED="\033[31m"
8+
GREEN="\033[32m"
9+
YELLOW="\033[33m"
10+
BLUE="\033[34m"
11+
CYAN="\033[36m"
12+
WHITE="\033[37m"
13+
DIM="\033[2m"
14+
15+
info() { echo -e "${BOLD}${BLUE}[atta]${RESET} $*"; }
16+
success() { echo -e "${BOLD}${GREEN}[atta]${RESET} $*"; }
17+
warn() { echo -e "${BOLD}${YELLOW}[atta]${RESET} $*"; }
18+
error() { echo -e "${BOLD}${RED}[atta]${RESET} $*"; }
19+
section() { echo -e "\n${BOLD}${CYAN}━━━ $* ${RESET}"; }
20+
421
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
522
SOURCE_PATH="$SCRIPT_PATH"
623
BUILD_PATH="$SOURCE_PATH/build"
@@ -19,75 +36,73 @@ CMAKE_VULKAN="-DATTA_VULKAN_SUPPORT=ON"
1936

2037
printHelp()
2138
{
22-
echo "Atta build script"
39+
echo -e "${BOLD}Atta build script${RESET}"
2340
echo
24-
echo "Usage: ./build.sh [option(s)]"
41+
echo -e "Usage: ${CYAN}./build.sh${RESET} ${DIM}[option(s)]${RESET}"
2542
echo
26-
echo "Options:"
43+
echo -e "${BOLD}Options:${RESET}"
2744
echo
28-
echo "-h or --help"
29-
echo " This help menu"
45+
echo -e " ${YELLOW}-h${RESET}, ${YELLOW}--help${RESET}"
46+
echo -e " This help menu"
3047
echo
31-
echo "-t or --type <option>"
32-
echo " Which type of build."
33-
echo " Valid options are: default, web, web_module, docs"
48+
echo -e " ${YELLOW}-t${RESET}, ${YELLOW}--type${RESET} ${DIM}<option>${RESET}"
49+
echo -e " Which type of build."
50+
echo -e " Valid options are: ${CYAN}default${RESET}, ${CYAN}web${RESET}, ${CYAN}web_module${RESET}, ${CYAN}docs${RESET}"
3451
echo
35-
echo "-d or --debug"
36-
echo " Build with debug information."
52+
echo -e " ${YELLOW}-d${RESET}, ${YELLOW}--debug${RESET}"
53+
echo -e " Build with debug information."
3754
echo
38-
echo "-D or --debugger"
39-
echo " Run with a debugger (prefers LLDB, falls back to GDB)."
55+
echo -e " ${YELLOW}-D${RESET}, ${YELLOW}--debugger${RESET}"
56+
echo -e " Run with a debugger (prefers LLDB, falls back to GDB)."
4057
echo
41-
echo "-c or --compiler <name>"
42-
echo " Select the compiler."
58+
echo -e " ${YELLOW}-c${RESET}, ${YELLOW}--compiler${RESET} ${DIM}<name>${RESET}"
59+
echo -e " Select the compiler."
4360
echo
44-
echo "-j or --jobs <num_jobs>"
45-
echo " Set number of jobs to use when building."
61+
echo -e " ${YELLOW}-j${RESET}, ${YELLOW}--jobs${RESET} ${DIM}<num_jobs>${RESET}"
62+
echo -e " Set number of jobs to use when building."
4663
echo
47-
echo "-s or --static <project_file>"
48-
echo " Build statically linked to a project."
49-
echo " The file should be a valid .atta"
64+
echo -e " ${YELLOW}-s${RESET}, ${YELLOW}--static${RESET} ${DIM}<project_file>${RESET}"
65+
echo -e " Build statically linked to a project."
66+
echo -e " The file should be a valid ${DIM}.atta${RESET}"
5067
echo
51-
echo "-r or --run"
52-
echo " Run after build."
68+
echo -e " ${YELLOW}-r${RESET}, ${YELLOW}--run${RESET}"
69+
echo -e " Run after build."
5370
echo
54-
echo "-p or --project <project_file>"
55-
echo " Specify project to run."
71+
echo -e " ${YELLOW}-p${RESET}, ${YELLOW}--project${RESET} ${DIM}<project_file>${RESET}"
72+
echo -e " Specify project to run."
5673
echo
57-
echo "-i or --install"
58-
echo " Install after build."
74+
echo -e " ${YELLOW}-i${RESET}, ${YELLOW}--install${RESET}"
75+
echo -e " Install after build."
5976
echo
60-
echo "--disable-vulkan"
61-
echo " Disable Vulkan support."
77+
echo -e " ${YELLOW}--disable-vulkan${RESET}"
78+
echo -e " Disable Vulkan support."
6279
exit
6380
}
6481

6582
buildDefault()
6683
{
67-
echo "---------- Building ----------"
68-
# Build
84+
section "Building"
6985
cmake $CMAKE_BUILD_TYPE $CMAKE_COMPILER $CMAKE_ATTA_STATIC $CMAKE_VULKAN $SOURCE_PATH
7086
make -j $NUM_JOBS
87+
success "Build complete"
7188

72-
# Install
7389
if [[ "$INSTALL_AFTER" == "true" ]]; then
74-
echo "---------- Installing ----------"
75-
sudo make install
90+
section "Installing"
91+
sudo make install
92+
success "Install complete"
7693
fi
7794

78-
# Run
7995
if [[ "$RUN_AFTER" == "true" ]]; then
80-
echo "---------- Running ----------"
96+
section "Running"
8197
if [[ "$USE_DEBUGGER" == "true" ]]; then
82-
# Detect available debugger (prefer LLDB)
8398
if command -v lldb &> /dev/null; then
84-
echo "Using LLDB for debugging..."
99+
info "Using LLDB for debugging..."
85100
lldb --one-line "run" -- bin/atta -- $PROJECT_TO_RUN
86101
elif command -v gdb &> /dev/null; then
87-
echo "Using GDB for debugging..."
102+
info "Using GDB for debugging..."
88103
gdb -ex r --args bin/atta $PROJECT_TO_RUN
89104
else
90-
echo -e "\033[1m\033[31m[Error] \033[0m\033[31mNo debugger found (LLDB or GDB). Install one to continue."
105+
error "No debugger found (LLDB or GDB). Install one to continue."
91106
exit 1
92107
fi
93108
else
@@ -100,10 +115,9 @@ buildDefault()
100115

101116
buildWeb()
102117
{
103-
# Check if emscripten is installed
104118
if ! command -v emcmake &> /dev/null
105119
then
106-
echo -e "\033[1m\033[31m[Error] \033[0m\033[31mEmscripten is not installed, please follow the instruction here: \033[37mhttps://emscripten.org/docs/getting_started/downloads.html"
120+
error "Emscripten is not installed, please follow the instructions at: ${WHITE}https://emscripten.org/docs/getting_started/downloads.html${RESET}"
107121
exit
108122
fi
109123

@@ -112,14 +126,13 @@ buildWeb()
112126
CMAKE_MODULE="-DATTA_WEB_BUILD_MODULE=ON"
113127
fi
114128

115-
# Build
116-
echo "---------- Building web ----------"
129+
section "Building web"
117130
emcmake cmake $CMAKE_MODULE $CMAKE_BUILD_TYPE $CMAKE_ATTA_STATIC $SOURCE_PATH
118131
make -j $NUM_JOBS
132+
success "Web build complete"
119133

120-
# Run
121134
if [[ "$RUN_AFTER" == "true" ]]; then
122-
echo "---------- Running web ----------"
135+
section "Running web"
123136
emrun bin/atta.html
124137
fi
125138

@@ -128,9 +141,10 @@ buildWeb()
128141

129142
buildDocs()
130143
{
131-
echo "---------- Building docs ----------"
144+
section "Building docs"
132145
cmake -ATTA_BUILD_DOCS=ON -DATTA_BUILD_TESTS=OFF $SOURCE_PATH
133146
make -j $NUM_JOBS
147+
success "Docs build complete"
134148
exit
135149
}
136150

@@ -192,7 +206,7 @@ while [[ $# -gt 0 ]]; do
192206
shift
193207
;;
194208
-*|--*)
195-
echo "Unknown option $1"
209+
error "Unknown option $1"
196210
exit
197211
;;
198212
esac
@@ -215,7 +229,7 @@ docs)
215229
buildDocs
216230
;;
217231
*)
218-
echo "Unknown build type $BUILD_TYPE"
232+
error "Unknown build type ${BOLD}$BUILD_TYPE${RESET}"
219233
exit
220234
;;
221235
esac

examples/tutorials/.clang-format

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: LLVM
4+
PointerAlignment: Left
5+
AlwaysBreakTemplateDeclarations: true
6+
ColumnLimit: 150
7+
IndentWidth: 4
8+
...

examples/tutorials/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/**/build/
2+
compile_commands.json
3+
.cache/

examples/tutorials/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--
2+
title: Tutorial
3+
description: Collection of atta tutorials
4+
image: https://storage.googleapis.com/atta-images/docs/tutorial/cube-factory/cube-factory.gif
5+
-->
6+
7+
# Tutorial
8+
This repository has many examples of how to use each atta feature.
9+
10+
**Browse through the projects in this repository [here](https://atta.brenocq.com/projects/brenocq-atta/tutorial).**
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
project(cube-factory)
3+
4+
find_package(atta 0.3.6 REQUIRED)
5+
6+
atta_add_target(cubeScript "src/cubeScript.cpp")

0 commit comments

Comments
 (0)