-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
134 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
BasedOnStyle: Google | ||
|
||
# Make it slightly more similar to Rust. | ||
# Based loosely on https://gist.github.com/YodaEmbedding/c2c77dc693d11f3734d78489f9a6eea4 | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: BlockIndent | ||
AllowAllArgumentsOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
BinPackArguments: false | ||
BreakStringLiterals: false | ||
ColumnLimit: 100 | ||
ContinuationIndentWidth: 4 | ||
DerivePointerAlignment: false | ||
EmptyLineBeforeAccessModifier: LogicalBlock | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: true | ||
InsertBraces: true | ||
InsertTrailingCommas: Wrapped | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: All | ||
PointerAlignment: Left | ||
ReflowComments: false | ||
SeparateDefinitionBlocks: Always | ||
SpacesBeforeTrailingComments: 1 | ||
|
||
# Don't change include blocks, we want to control this manually. | ||
# Sorting headers however is allowed as all our headers should be standalone. | ||
IncludeBlocks: Preserve | ||
SortIncludes: CaseInsensitive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
on: [push, pull_request] | ||
|
||
name: C++ | ||
|
||
jobs: | ||
pixi-build: | ||
name: "pixi build" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: prefix-dev/[email protected] | ||
with: | ||
pixi-version: v0.6.0 | ||
cache: true | ||
|
||
- run: pixi run build | ||
|
||
# TODO(emilk): Add a step to check formatting etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
# Mac stuff: | ||
.DS_Store | ||
|
||
# C++ build directory | ||
build | ||
|
||
# Rust compile target directory: | ||
**/target | ||
**/target_ra | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.16...3.27) | ||
|
||
project(rerun_template LANGUAGES CXX) # TODO | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
if(NOT DEFINED CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
|
||
# Rerun: | ||
include(FetchContent) | ||
FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/0.15.1/rerun_cpp_sdk.zip) | ||
FetchContent_MakeAvailable(rerun_sdk) | ||
|
||
add_executable(rerun_template src/main.cpp) # TODO | ||
target_link_libraries(rerun_template rerun_sdk) # TODO | ||
target_include_directories(rerun_template PRIVATE src) # TODO |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,13 @@ authors = ["rerun.io <[email protected]>"] | |
categories = [] # TODO | ||
description = "" # TODO | ||
edition = "2021" | ||
homepage = "https://github.com/rerun-io/template" # TODO | ||
homepage = "https://github.com/rerun-io/rerun_template" # TODO | ||
include = ["LICENSE-APACHE", "LICENSE-MIT", "**/*.rs", "Cargo.toml"] | ||
keywords = [] # TODO | ||
license = "MIT OR Apache-2.0" | ||
name = "template" # TODO | ||
name = "rerun_template" # TODO | ||
readme = "README.md" | ||
repository = "https://github.com/rerun-io/template" # TODO | ||
repository = "https://github.com/rerun-io/rerun_template" # TODO | ||
rust-version = "1.76" | ||
version = "0.1.0" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Pixi is a package management tool for developers. | ||
# Before running a task, pixi ensures that all listed dependencies are installed first.echop | ||
# | ||
# Pixi is not required for rerun, but it is a convenient way to install the | ||
# dependencies required for this example. | ||
# | ||
# https://prefix.dev/docs/pixi/overview | ||
# | ||
# Use `pixi task list` to list the available tasks, | ||
# and `pixi run TASK` to run it (e.g. `pixi run example`). | ||
|
||
[project] | ||
name = "rerun_template" # TODO | ||
authors = ["rerun.io <[email protected]>"] | ||
channels = ["conda-forge"] | ||
description = "rerun_template" # TODO | ||
homepage = "https://rerun.io" | ||
license = "MIT OR Apache-2.0" | ||
|
||
platforms = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64", "win-64"] | ||
readme = "README.md" | ||
repository = "https://github.com/rerun-io/rerun_template" # TODO | ||
version = "0.1.0" | ||
|
||
|
||
[tasks] | ||
# C++ stuff: | ||
# Note: extra CLI argument after `pixi run TASK` are passed to the task cmd. | ||
clean = { cmd = "rm -rf build bin CMakeFiles/" } | ||
print-env = { cmd = "echo $PATH" } | ||
prepare = "cmake -G 'Ninja' -B build -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo" | ||
build = { cmd = "cmake --build build --config RelWithDebInfo --target all", depends_on = [ | ||
"prepare", | ||
] } | ||
example = { cmd = "build/rerun_template", depends_on = ["build"] } | ||
format = { cmd = "clang-format -i src/*" } | ||
|
||
[dependencies] | ||
# C++ build-tools: | ||
cmake = "3.27.6" | ||
clang-tools = ">=15,<16" # clang-format | ||
cxx-compiler = "1.6.0.*" | ||
ninja = "1.11.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <cstdio> | ||
|
||
#include <rerun.hpp> | ||
|
||
int main(int argc, const char* argv[]) { | ||
printf("Hello, World!\n"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fn main() { | ||
println!("Hello, template!"); | ||
println!("Hello, rerun_template!"); | ||
} |