Skip to content

Commit 4ab46c6

Browse files
Initial Documentations
1 parent 72edb8c commit 4ab46c6

16 files changed

+1884
-65
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Resources/embed.exe
5050

5151
# Natural Docs cache data
5252
DocsGeneration/ND_Config/Working\ Data
53-
docs/
53+
# docs/
5454

5555
# Language server files
5656
.cache/

DefaultYAMLs/DefaultScriptInfo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Dependencies:
141141
# (Optional) Import dependency configuration from a YAML file if this field exists
142142
# All other fields (Name, Platforms, etc...) are not needed if this field exists
143143
# For Git source: Path is relative to the git repository root
144-
# For Local source: Path is relative to the script directory.
144+
# For Local source: Path is relative to the path specified under `Local`
145145
# If neither source exists, local source with root script directory is assumed.
146146
ImportPath: "config/dependency.yaml"
147147

README.md

Lines changed: 38 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,75 @@
11
# runcpp2
22

3-
![runcpp2 logo](./Runcpp2Logo.png)
3+
![](./Runcpp2Logo.png)
44

5-
A cross-platform declarative <s>and scriptable (WIP)</s> build system for c++ with the addition of letting you run any c++ files as a script, just like python!
5+
runcpp2 is a simple declarable, scriptable, flexible cross-platform build system build system for c or c++
66

7-
### 🛠️ Prerequisites
8-
- Any C++ compiler. The default user config only has g++ and msvc profiles. But feel free to
7+
- 🚀 **Simple**: `runcpp2 main.cpp`, this is all you need to get started
8+
- 📝 **Declarable**: *Quick, Concise, Minimal* YAML format
9+
- 🔧 **Scriptable**: *Customize, Run And Debug* your build pipeline with c++, or just use it as a script.
10+
No longer need to juggle between CMake, Python, Bash, Batch, Lua, etc...
11+
- 🪜 **Flexible**: *YAML* for small project, *c++* for finer control
12+
13+
For more information, see [Full Documentation](https://neko-box-coder.github.io/runcpp2/latest/)
14+
15+
## 🛠️ Prerequisites
16+
- Any c or c++ compiler. The default user config only has g++ and msvc profiles. But feel free to
917
add other compilers.
1018

11-
### 📥️ Installation
19+
## 📥️ Installation
1220
You can either build from source or use the binary release
1321

14-
To build from source:
15-
1. Clone the repository with `git clone --recursive https://github.com/Neko-Box-Coder/runcpp2.git`
16-
2. Run `Build.sh` or `Build.bat` to build
17-
1822
Binary Release (Only Linux and Windows for now):
1923
[https://github.com/Neko-Box-Coder/runcpp2/releases](https://github.com/Neko-Box-Coder/runcpp2/releases)
2024

2125

2226
Finally, you just need to add runcpp2 binary location to the `PATH` environment variable and
2327
you can run c++ files anywhere you want.
2428

25-
### ⚡️ Getting Started
29+
## ⚡️ Getting Started
2630

27-
#### 1. Running directly
31+
### 1. Running source file directly
2832
Suppose you have a c++ file called `script.cpp`, you can run it immediately by doing
2933

34+
> *shell*
3035
```shell
3136
runcpp2 ./script.cpp <any arguments>
3237
```
3338

3439
> [!NOTE]
35-
> On Unix, if you have added runcpp2 to your PATH and add this line `//bin/true;runcpp2 "$0" "$@"; exit;` to the top of your script, you can run the script directly by `./script.cpp <arguments>`
40+
> On Unix, if you have added runcpp2 to your PATH and add this line `//bin/true;runcpp2 "$0" "$@"; exit $?;`
41+
> to the top of your script, you can run the script directly by `./script.cpp <arguments>`
3642
37-
#### 2. Watch and give compile errors
43+
---
44+
45+
### 2. Watch and give compile errors
3846
If you want to edit the script but want to have feedback for any error, you can use "watch" mode.
3947

48+
> *shell*
4049
```shell
4150
runcpp2 --watch ./script.cpp
4251
```
4352

44-
#### 3. Adding script build settings
45-
If you want to add custom build settings such as compile/link flags, specify profile, etc.
46-
You will need to provide such settings to runcpp2 in the format of YAML.
47-
48-
This build settings can either be embedded as comment in the script itself, or provided as
49-
a YAML file.
53+
---
5054

51-
To generate a script build settings template, do
55+
### 3. Sepcifying Build Settings
56+
Build settings such as compile/link flags, external dependencies, command hooks, etc.
57+
can be spcified inlined inside a source file or as a separate yaml file in the format of YAML
5258

53-
```shell
54-
# Embeds the build settings template as comment
55-
runcpp2 --create-script-template ./script.cpp
56-
57-
# Creates the build settings template as dedicated yaml file
58-
runcpp2 --create-script-template ./script.yaml
59-
60-
# Short form
61-
runcpp2 -t ./script.cpp
62-
```
59+
- To specify build settings in a dedicated yaml file:
60+
- The yaml file in the same directory and share the same as the source file being run will be used
61+
- To specify inline build settings inside a source file:
62+
- Put them inside a comment with `runcpp2` at the beginning of the build settings
63+
- The inline build settings can exist in anywhere of the source file
64+
- Both inline (but continuous) comments (`//`) and block comments are supported (`/* */`)
6365

64-
This will generate the script build settings template for you.
65-
Everything is documented as comment in the template but here's a quick summary.
66-
67-
- `RequiredProfiles`: To specify a specific profile for building for different platforms
68-
- `OverrideCompileFlags`: Compile flags to be added or removed from the current profile
69-
- `OverrideLinkFlags`: Same as `OverrideCompileFlags` but for linking
70-
- `OtherFilesToBeCompiled`: Other source files you wish to be compiled.
71-
- `Dependencies`: Any external libraries you wish to use. See next section.
72-
73-
> [!NOTE]
74-
> Settings in the script info are passed directly to the shell. Be cautious when using user-provided input in your build commands.
75-
76-
#### 4. Using External Libraries
77-
78-
To use any external libraries, you need to specify them in the Dependencies section.
79-
Here's a quick run down on the important fields
80-
81-
- `Source`: This specifies the source of the external dependency.
82-
It can either be type `Git` or `Local` where it will clone the repository if it is `Git` or
83-
copy the library folder in the filesystem if it is `Local`
84-
- `LibraryType`: This specifies the dependency type to be either `Static`, `Object`, `Shared`
85-
or `Header`
86-
- `IncludePaths`: The include paths relative to the root of the dependency folder
87-
- `LinkProperties`: Settings for linking
88-
- `Setup`, `Build` and `Cleanup`: List of shell commands for one time setup, building and
89-
cleaning up
90-
91-
To access the source files of the dependencies, you can specify runcpp2 to build locally in
92-
the current working directory by passing the `--local` flag. This is useful when you want to
93-
look at the headers of the dependencies.
66+
For a complete list of build settings, see [Build Settings](https://neko-box-coder.github.io/runcpp2/latest/build_settings/) or generate the template with
9467

68+
> *shell*
9569
```shell
96-
runcpp2 --local ./script.cpp
70+
runcpp2 --create-script-template ./script.cpp # Embeds the build settings template as comment
71+
runcpp2 --create-script-template ./script.yaml # Creates the build settings template as dedicated yaml file
72+
runcpp2 -t ./script.cpp # Short form
9773
```
9874

99-
This will create a `.runcpp2` folder in the current working directory, and all the builds and dependencies will be inside it.
75+

TODO.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
TODO:
22
- Allow runcpp2 to be library
3-
- Add the ability to specify different profiles for different source files
3+
- Add the ability to specify different profiles(?)/defines for different source files
4+
- Add the ability to use symlinks for local dependency
5+
- Add the ability to append defines coming from the dependencies
6+
- Add the ability for user to specify custom substitution options which applies to all fields
47
- Ability to compile runcpp2 as single cpp
58
- Ability to skip DefaultPlatform and DefaultProfile
69
- Async compile
@@ -26,3 +29,6 @@ TODO:
2629
- Add version for user config and prompt for update
2730
- Output compile_command.json
2831
- Allow Languages to override FileExtensions in compiler profile (?)
32+
33+
34+

mkdocs/docs/Runcpp2Logo.png

3.64 KB
Loading

0 commit comments

Comments
 (0)