1- # NOTE: All command substitutions are passed directly to the shell.
2- # Be cautious when using user-provided input in your build commands to avoid potential security risks.
3-
4- # NOTE: All the options here are defaulted to empty.
5- # You can uncomment different sections to set what you want.
6-
7- # (Optional) Whether to pass the script path as the second parameter when running
1+ # This is the template for specifying build settings.
2+ # Many of the settings are passed directly to the shell.
3+ # Be cautious when using user-provided input in your build commands to avoid potential security risks.
4+ # Output from commands such as Setup or Cleanup won't be shown unless log level is set to info.
5+ # If the default is not mentioned for a setting, it will be empty.
6+
7+ # Each of the platform dependent settings can be listed under
8+ # - DefaultPlatform
9+ # - Windows
10+ # - Linux
11+ # - MacOS
12+ # - Unix
13+
14+ # You can find all the profiles in your config folder.
15+ # This can be found by running `runcpp2 --show-config-path`.
16+ # Specifying "DefaultProfile" in the profile name will allow any profiles
17+ # and use the user's preferred one.
18+
19+ # (Optional) Whether to pass the script path as the second parameter when running. Default is false
820PassScriptPath : false
921
10- # # (Optional) Language of the script
22+ # (Optional) Language of the script. Default is determined by file extension
1123Language : " c++"
1224
13- # (Optional) Preferred profiles for the script for each platform.
14- # Profiles are listed in user config file,
15- # which can be retreived by running `runcpp2 --show-config-path`
16- # Each of the platform dependent settings can be listed under
17- # - Default
18- # - Windows
19- # - Linux
20- # - MacOS
21- # - Unix
25+ # (Optional) The type of output to build. Default is Executable
26+ # Supported types:
27+ # - Executable: Build as executable that can be run
28+ # - Static: Build as static library (.lib/.a)
29+ # - Shared: Build as shared library (.dll/.so)
30+ # - Objects: Only compile to object files without linking
31+ BuildType : Executable
32+
33+ # TODO: Rename this
34+ # (Optional) Allowed profiles for the script for each platform.
35+ # Any profiles will be used if none is specified for the platform.
2236RequiredProfiles :
2337 Windows : ["g++"]
2438 Linux : ["g++"]
@@ -28,7 +42,7 @@ RequiredProfiles:
2842OverrideCompileFlags :
2943 # Target Platform
3044 DefaultPlatform :
31- # Profile with the respective flags to override. ("DefaultProfile" for any profile)
45+ # Profile with the respective flags to override
3246 " g++ " :
3347 # (Optional) Flags to be removed from the default compile flags, separated by space
3448 Remove : " "
@@ -40,7 +54,7 @@ OverrideCompileFlags:
4054OverrideLinkFlags :
4155 # Target Platform
4256 DefaultPlatform :
43- # Profile with the respective flags to override ("DefaultProfile" for any profile)
57+ # Profile with the respective flags to override
4458 " g++ " :
4559 # (Optional) Flags to be removed from the default link flags, separated by space
4660 Remove : " "
@@ -59,35 +73,35 @@ OtherFilesToBeCompiled:
5973
6074# (Optional) Include paths (relative to script file path) for each platform and profile
6175IncludePaths :
62- # Target Platform (DefaultPlatform, Windows, Linux, MacOS, or Unix)
76+ # Target Platform
6377 DefaultPlatform :
64- # Target Profile (e.g., "g++", "clang++", "msvc", or "DefaultProfile" for any profile)
78+ # Target Profile
6579 DefaultProfile :
6680 - " ./include"
6781 - " ./src/include"
6882
6983# (Optional) Define cross-compiler defines for each platform and profile.
70- # Defines can be specified as just a name or as a name-value pair.
84+ # Defines can be specified as just a name or as a name-value pair.
7185Defines :
72- # Target Platform (DefaultPlatform, Windows, Linux, MacOS, or Unix)
86+ # Target Platform
7387 DefaultPlatform :
74- # Profile name (e.g., "g++", "clang++", "msvc", or "DefaultProfile" for any profile)
88+ # Profile name
7589 DefaultProfile :
7690 - " EXAMPLE_DEFINE" # Define without a value
7791 - " VERSION_MAJOR=1" # Define with a value
7892
7993# (Optional) Setup commands are run once before the script is first built.
80- # These commands are run at the script's location when no build directory exists.
94+ # These commands are run at the script's location when no build directory exists.
8195Setup :
82- # Target Platform (DefaultPlatform, Windows, Linux, MacOS, or Unix)
96+ # Target Platform
8397 DefaultPlatform :
84- # Profile name (e.g., "g++", "clang++", "msvc", or "DefaultProfile" for any profile)
98+ # Profile name
8599 DefaultProfile :
86100 # List of setup commands
87101 - " echo Setting up script..."
88102
89103# (Optional) PreBuild commands are run before each build.
90- # These commands are run in the build directory before compilation starts.
104+ # These commands are run in the build directory before compilation starts.
91105PreBuild :
92106 # Target Platform
93107 DefaultPlatform :
@@ -96,7 +110,7 @@ PreBuild:
96110 - " echo Starting build..."
97111
98112# (Optional) PostBuild commands are run after each successful build.
99- # These commands are run in the output directory where binaries are located.
113+ # These commands are run in the output directory where binaries are located.
100114PostBuild :
101115 # Target Platform
102116 DefaultPlatform :
@@ -105,7 +119,7 @@ PostBuild:
105119 - " echo Build completed..."
106120
107121# (Optional) Cleanup commands are run when using the --cleanup option.
108- # These commands are run at the script's location before the build directory is removed.
122+ # These commands are run at the script's location before the build directory is removed.
109123Cleanup :
110124 # Target Platform
111125 DefaultPlatform :
@@ -121,23 +135,26 @@ Dependencies:
121135 # Supported platforms of the dependency
122136 Platforms : [Windows, Linux, MacOS]
123137
124- # The source of getting the dependency (Git, Local)
138+ # Where to get and copy the dependency (Git, Local)
139+ # Either Git or Local can exist, not both
125140 Source :
126- # (Optional) Import dependency configuration from a YAML file
127- # For Git source: Path is relative to the git repository root
128- # For Local source: Path is relative to the script directory.
129- # If neither source exists, local source with root script directory is assumed.
130- # ImportPath: "config/dependency.yaml"
141+ # (Optional) Import dependency configuration from a YAML file if this field exists
142+ # All other fields (Name, Platforms, etc...) are not needed if this field exists
143+ # For Git source: Path is relative to the git repository root
144+ # For Local source: Path is relative to the script directory.
145+ # If neither source exists, local source with root script directory is assumed.
146+ ImportPath : " config/dependency.yaml"
131147
132- # Git: Dependency or import YAML file exists in a git server, and needs to be cloned.
148+ # Dependency or import YAML file exists in a git server, and needs to be cloned to build directory
133149 Git :
134150 # Git repository URL
135151 URL : " https://github.com/MyUser/MyLibrary.git"
136152
137- # Local: Dependency or import YAML file exists in local filesystem
138- # Local:
139- # # Path to the library directory
140- # Path: "./libs/LocalLibrary"
153+ # Dependency or import YAML file exists in local filesystem directory,
154+ # and needs to be copied to build directory
155+ Local :
156+ # Path to the library directory
157+ Path : " ./libs/LocalLibrary"
141158
142159
143160 # Library Type (Static, Object, Shared, Header)
@@ -158,7 +175,7 @@ Dependencies:
158175 SearchLibraryNames : ["MyLibrary"]
159176
160177 # (Optional) The library names to be excluded from being searched.
161- # Works the same as SearchLibraryNames but will NOT be linked instead
178+ # Works the same as SearchLibraryNames but will NOT be linked instead
162179 ExcludeLibraryNames : []
163180
164181 # The path (relative to the dependency folder) to be searched for the dependency binaries
@@ -182,23 +199,25 @@ Dependencies:
182199 Build :
183200 # Target Platform
184201 DefaultPlatform :
185- # Target Profile ("DefaultProfile" for any profile)
202+ # Target Profile
186203 " g++ " :
187204 - " cd build && cmake .."
188205 - " cd build && cmake --build ."
189206
190207 # (Optional) Cleanup commands are run when the reset option is present. Normally nothing needs
191208 # to be done since the dependency folder will be removed automatically.
192209 Cleanup :
210+ # Target Platform
193211 Linux :
212+ # Target Profile
194213 " g++ " :
195214 - " sudo apt purge MyLibrary"
196215
197216 # (Optional) Files to be copied to next to output binary for each platform and profile
198217 FilesToCopy :
199- # Target Platform (DefaultPlatform, Windows, Linux, MacOS, or Unix)
218+ # Target Platform
200219 DefaultPlatform :
201- # Profile name (e.g., "g++", "clang++", "msvc", or "DefaultProfile" for any profile)
220+ # Profile name
202221 DefaultProfile :
203222 # List of files to copy (relative to the dependency folder)
204223 - " assets/textures/sprite.png"
0 commit comments