Skip to content

Commit 03d7398

Browse files
Merge pull request #29 from Neko-Box-Coder/SpecificDefault
Specify default
2 parents b185aa5 + 86df61e commit 03d7398

File tree

7 files changed

+67
-68
lines changed

7 files changed

+67
-68
lines changed

DefaultYAMLs/DefaultScriptInfo.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ RequiredProfiles:
2727
# (Optional) Override the default compile flags for each platform.
2828
OverrideCompileFlags:
2929
# Target Platform
30-
Default:
31-
# Profile with the respective flags to override. ("Default" for any profile)
30+
DefaultPlatform:
31+
# Profile with the respective flags to override. ("DefaultProfile" for any profile)
3232
"g++":
3333
# (Optional) Flags to be removed from the default compile flags, separated by space
3434
Remove: ""
@@ -39,8 +39,8 @@ OverrideCompileFlags:
3939
# (Optional) Override the default link flags for each platform.
4040
OverrideLinkFlags:
4141
# Target Platform
42-
Default:
43-
# Profile with the respective flags to override ("Default" for any profile)
42+
DefaultPlatform:
43+
# Profile with the respective flags to override ("DefaultProfile" for any profile)
4444
"g++":
4545
# (Optional) Flags to be removed from the default link flags, separated by space
4646
Remove: ""
@@ -52,18 +52,18 @@ OverrideLinkFlags:
5252
# (Optional) Other source files (relative to script file path) to be compiled.
5353
OtherFilesToBeCompiled:
5454
# Target Platform
55-
Default:
55+
DefaultPlatform:
5656
# Target Profile
57-
Default:
57+
DefaultProfile:
5858
- "./AnotherSourceFile.cpp"
5959

6060
# (Optional) Define cross-compiler defines for each platform and profile.
6161
# Defines can be specified as just a name or as a name-value pair.
6262
Defines:
63-
# Target Platform (Default, Windows, Linux, MacOS, or Unix)
64-
Default:
65-
# Profile name (e.g., "g++", "clang++", "msvc", or "Default" for any profile)
66-
"Default":
63+
# Target Platform (DefaultPlatform, Windows, Linux, MacOS, or Unix)
64+
DefaultPlatform:
65+
# Profile name (e.g., "g++", "clang++", "msvc", or "DefaultProfile" for any profile)
66+
"DefaultProfile":
6767
- "EXAMPLE_DEFINE" # Define without a value
6868
- "VERSION_MAJOR=1" # Define with a value
6969

@@ -117,7 +117,7 @@ Dependencies:
117117
Default:
118118
# Setup shell commands for the specified profile.
119119
# Default commands are run in the dependency folder
120-
# You can also use "Default" if all the compilers run the same setup commands
120+
# You can also use "DefaultProfile" if all the compilers run the same setup commands
121121
"g++":
122122
- "mkdir build"
123123

@@ -126,7 +126,7 @@ Dependencies:
126126
Build:
127127
# Target Platform
128128
Default:
129-
# Target Profile ("Default" for any profile)
129+
# Target Profile ("DefaultProfile" for any profile)
130130
"g++":
131131
- "cd build && cmake .."
132132
- "cd build && cmake --build ."
@@ -140,10 +140,10 @@ Dependencies:
140140

141141
# (Optional) Files to be copied to next to output binary for each platform and profile
142142
FilesToCopy:
143-
# Target Platform (Default, Windows, Linux, MacOS, or Unix)
144-
Default:
145-
# Profile name (e.g., "g++", "clang++", "msvc", or "Default" for any profile)
146-
"Default":
143+
# Target Platform (DefaultPlatform, Windows, Linux, MacOS, or Unix)
144+
DefaultPlatform:
145+
# Profile name (e.g., "g++", "clang++", "msvc", or "DefaultProfile" for any profile)
146+
DefaultProfile:
147147
# List of files to copy (relative to the dependency folder)
148148
- "assets/textures/sprite.png"
149149
Windows:

DefaultYAMLs/DefaultUserConfig.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ Templates:
4545

4646
# TODO: Add support for custom platform
4747
# Each of the platform dependent settings can be listed under
48-
# - Default
48+
# - DefaultPlatform
4949
# - Windows
5050
# - Linux
5151
# - MacOS
5252
# - Unix
5353
FilesTypes: &CommonFilesTypes
5454
ObjectLinkFile:
5555
Prefix:
56-
Default: ""
56+
DefaultPlatform: ""
5757
Extension:
5858
Windows: ".obj"
5959
Unix: ".o"
@@ -123,12 +123,12 @@ Profiles:
123123
# (Optional) The commands to run in **shell** before calling the compiler/linker for each platform.
124124
# This is run inside the .runcpp2 directory where the build happens.
125125
# Setup:
126-
# Default: []
126+
# DefaultPlatform: []
127127

128128
# (Optional) The commands to run in **shell** after calling the compiler/linker for each platform.
129129
# This is run inside the .runcpp2 directory where the build happens.
130130
# Cleanup:
131-
# Default: []
131+
# DefaultPlatform: []
132132

133133
# The file properties for the object files for each platform.
134134
FilesTypes: *CommonFilesTypes
@@ -137,11 +137,11 @@ Profiles:
137137
Compiler:
138138
# (Optional) The command to be prepend for each compile command in **shell** for each platform
139139
# PreRun:
140-
# Default: ""
140+
# DefaultPlatform: ""
141141

142142
# Shell command to use for checking if the executable exists or not
143143
CheckExistence:
144-
Default: "g++ -v"
144+
DefaultPlatform: "g++ -v"
145145

146146
# Here are a list of substitution strings for RunParts, Setup and Cleanup
147147
# {Executable}: Compiler executable
@@ -162,7 +162,7 @@ Profiles:
162162
# {OutputFilePath}: (Similar to previous)
163163
CompileTypes:
164164
Executable:
165-
Default:
165+
DefaultPlatform:
166166
Flags: "-std=c++17 -Wall -g"
167167
Executable: "g++"
168168
RunParts: *g++_CompileRunParts
@@ -173,14 +173,14 @@ Profiles:
173173
# This is run inside the .runcpp2 directory where the build happens.
174174
# Cleanup: []
175175
Static:
176-
Default:
176+
DefaultPlatform:
177177
Flags: "-std=c++17 -Wall -g"
178178
Executable: "g++"
179179
RunParts: *g++_CompileRunParts
180180
# Setup: []
181181
# Cleanup: []
182182
Shared:
183-
Default:
183+
DefaultPlatform:
184184
Flags: "-std=c++17 -Wall -g -fpic"
185185
Executable: "g++"
186186
RunParts: *g++_CompileRunParts
@@ -191,11 +191,11 @@ Profiles:
191191
Linker:
192192
# (Optional) The command to be prepend for each link command in **shell** for each platform
193193
# PreRun:
194-
# Default: ""
194+
# DefaultPlatform: ""
195195

196196
# Shell command to use for checking if the executable exists or not
197197
CheckExistence:
198-
Default: "g++ -v"
198+
DefaultPlatform: "g++ -v"
199199

200200
# Here are a list of substitution strings for RunParts, Setup and Cleanup
201201
# {Executable}: Linker executable
@@ -240,7 +240,7 @@ Profiles:
240240
# Setup: []
241241
# Cleanup: []
242242
Static:
243-
Default:
243+
DefaultPlatform:
244244
Flags: ""
245245
Executable: "g++"
246246
RunParts: *g++_LinkRunParts

Examples/test.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ PassScriptPath: true
1010
1111
OtherFilesToBeCompiled:
1212
# Target Platform
13-
Default:
13+
DefaultPlatform:
1414
# Target Profile
1515
"g++":
1616
- "./OtherSources/AnotherSourceFileGcc.cpp"
1717
"msvc":
1818
- "./OtherSources/AnotherSourceFileMSVC.cpp"
1919
2020
Defines:
21-
Default:
21+
DefaultPlatform:
2222
# Turns into `TEST_DEF=\"Test Define Working\"` in shell
23-
Default: ["TEST_DEF=\\\"Test Define Working\\\""]
23+
DefaultProfile: ["TEST_DEF=\\\"Test Define Working\\\""]
2424
2525
Dependencies:
2626
- Name: ssLogger
@@ -31,36 +31,36 @@ PassScriptPath: true
3131
LibraryType: Shared
3232
IncludePaths: ["Include"]
3333
LinkProperties:
34-
Default:
35-
Default:
34+
DefaultPlatform:
35+
DefaultProfile:
3636
SearchLibraryNames: ["ssLogger"]
3737
ExcludeLibraryNames: ["ssLogger_SRC"]
3838
SearchDirectories: ["./build", "./build/Debug", "./build/Release"]
3939
Setup:
40-
Default:
41-
Default:
40+
DefaultPlatform:
41+
DefaultProfile:
4242
- "mkdir build"
4343
Build:
44-
Default:
45-
Default:
44+
DefaultPlatform:
45+
DefaultProfile:
4646
- "cd build && cmake .. -DssLOG_BUILD_TYPE=SHARED"
4747
- "cd build && cmake --build . --config Release -j 16"
4848
FilesToCopy:
4949
# Target Platform (Default, Windows, Linux, MacOS, or Unix)
50-
Default:
51-
Default:
50+
DefaultPlatform:
51+
DefaultProfile:
5252
- "./Include/ssLogger/ssLog.hpp"
5353
5454
- Name: System2.cpp
55-
Platforms: [Default]
55+
Platforms: [DefaultPlatform]
5656
Source:
5757
Type: Git
5858
Value: "https://github.com/Neko-Box-Coder/System2.cpp.git"
5959
LibraryType: Header
6060
IncludePaths: [".", "./External/System2"]
6161
Setup:
62-
Default:
63-
Default:
62+
DefaultPlatform:
63+
DefaultProfile:
6464
- "git submodule update --init --recursive"
6565
*/
6666

Src/Tests/Data/ProfileTest.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ int main(int argc, char** argv)
1717
FileExtensions: [.cpp, .cc, .cxx]
1818
Languages: ["c++"]
1919
Setup:
20-
Default: ["setup command 1", "setup command 2"]
20+
DefaultPlatform: ["setup command 1", "setup command 2"]
2121
Cleanup:
22-
Default: []
22+
DefaultPlatform: []
2323
FilesTypes:
2424
ObjectLinkFile:
2525
Prefix:
26-
Default: ""
26+
DefaultPlatform: ""
2727
Extension:
2828
Windows: ".obj"
2929
Unix: ".o"
@@ -54,12 +54,12 @@ int main(int argc, char** argv)
5454
Unix: ".a"
5555
Compiler:
5656
PreRun:
57-
Default: ""
57+
DefaultPlatform: ""
5858
CheckExistence:
59-
Default: "g++ -v"
59+
DefaultPlatform: "g++ -v"
6060
CompileTypes:
6161
Executable:
62-
Default:
62+
DefaultPlatform:
6363
Flags: "-std=c++17 -Wall -g"
6464
Executable: "g++"
6565
RunParts:
@@ -70,24 +70,24 @@ int main(int argc, char** argv)
7070
- Type: Once
7171
CommandPart: " \"{InputFilePath}\" -o \"{OutputFilePath}\""
7272
Static:
73-
Default:
73+
DefaultPlatform:
7474
Flags: "-std=c++17 -Wall -g"
7575
Executable: "g++"
7676
RunParts:
7777
- Type: Once
7878
CommandPart: "{Executable} -c {CompileFlags}"
7979
Shared:
80-
Default:
80+
DefaultPlatform:
8181
Flags: "-std=c++17 -Wall -g -fpic"
8282
Executable: "g++"
8383
RunParts:
8484
- Type: Once
8585
CommandPart: "{Executable} -c {CompileFlags}"
8686
Linker:
8787
PreRun:
88-
Default: ""
88+
DefaultPlatform: ""
8989
CheckExistence:
90-
Default: "g++ -v"
90+
DefaultPlatform: "g++ -v"
9191
LinkTypes:
9292
Executable:
9393
Unix:
@@ -103,7 +103,7 @@ int main(int argc, char** argv)
103103
- Type: Once
104104
CommandPart: "{Executable} {LinkFlags} -o \"{OutputFilePath}\""
105105
Static:
106-
Default:
106+
DefaultPlatform:
107107
Flags: ""
108108
Executable: "g++"
109109
RunParts:
@@ -154,12 +154,12 @@ int main(int argc, char** argv)
154154
ssTEST_OUTPUT_ASSERT("Languages contains c++", profile.Languages.count("c++") == 1);
155155

156156
//Verify Setup
157-
ssTEST_OUTPUT_ASSERT("Setup has Default platform", profile.Setup.count("Default") == 1);
157+
ssTEST_OUTPUT_ASSERT("Setup has Default platform", profile.Setup.count("DefaultPlatform") == 1);
158158
ssTEST_OUTPUT_SETUP
159159
(
160-
const std::vector<std::string>& setupCommands = profile.Setup.at("Default");
160+
const std::vector<std::string>& setupCommands = profile.Setup.at("DefaultPlatform");
161161
);
162-
ssTEST_OUTPUT_ASSERT("Setup Default has 2 commands", setupCommands.size() == 2);
162+
ssTEST_OUTPUT_ASSERT("Setup DefaultPlatform has 2 commands", setupCommands.size() == 2);
163163
ssTEST_OUTPUT_ASSERT("Setup command 1", setupCommands.at(0) == "setup command 1");
164164
ssTEST_OUTPUT_ASSERT("Setup command 2", setupCommands.at(1) == "setup command 2");
165165

@@ -183,11 +183,11 @@ int main(int argc, char** argv)
183183
sharedLinkFile.Extension.at("Linux") == ".so");
184184

185185
//Verify Compiler
186-
ssTEST_OUTPUT_ASSERT( "Compiler CheckExistence Default",
187-
profile.Compiler.CheckExistence.at("Default") == "g++ -v");
186+
ssTEST_OUTPUT_ASSERT( "Compiler CheckExistence DefaultPlatform",
187+
profile.Compiler.CheckExistence.at("DefaultPlatform") == "g++ -v");
188188
ssTEST_OUTPUT_SETUP
189189
(
190-
const auto& executableCompile = profile.Compiler.OutputTypes.Executable.at("Default");
190+
const auto& executableCompile = profile.Compiler.OutputTypes.Executable.at("DefaultPlatform");
191191
);
192192
ssTEST_OUTPUT_ASSERT( "Compiler Executable flags",
193193
executableCompile.Flags == "-std=c++17 -Wall -g");
@@ -197,8 +197,8 @@ int main(int argc, char** argv)
197197
executableCompile.RunParts.size() == 3);
198198

199199
//Verify Linker
200-
ssTEST_OUTPUT_ASSERT( "Linker CheckExistence Default",
201-
profile.Linker.CheckExistence.at("Default") == "g++ -v");
200+
ssTEST_OUTPUT_ASSERT( "Linker CheckExistence DefaultPlatform",
201+
profile.Linker.CheckExistence.at("DefaultPlatform") == "g++ -v");
202202
ssTEST_OUTPUT_SETUP
203203
(
204204
const auto& executableLink = profile.Linker.OutputTypes.Executable.at("Unix");

Src/runcpp2/Data/Profile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void runcpp2::Data::Profile::GetNames(std::vector<std::string>& outNames) const
1111
outNames.push_back(alias);
1212

1313
//Special name all that applies to all profile
14-
outNames.push_back("Default");
14+
outNames.push_back("DefaultProfile");
1515
}
1616

1717
bool runcpp2::Data::Profile::ParseYAML_Node(ryml::ConstNodeRef& profileNode)

Src/runcpp2/PlatformUtil.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ std::string runcpp2::ProcessPath(const std::string& path)
5757
std::vector<std::string> runcpp2::GetPlatformNames()
5858
{
5959
#ifdef _WIN32
60-
return {"Windows", "Default"};
60+
return {"Windows", "DefaultPlatform"};
6161
#elif __linux__
62-
return {"Linux", "Unix", "Default"};
62+
return {"Linux", "Unix", "DefaultPlatform"};
6363
#elif __APPLE__
64-
return {"MacOS", "Unix", "Default"};
64+
return {"MacOS", "Unix", "DefaultPlatform"};
6565
#elif __unix__
66-
return {"Unix", "Default"};
66+
return {"Unix", "DefaultPlatform"};
6767
#else
68-
return {"Unknown", "Default"};
68+
return {"Unknown", "DefaultPlatform"};
6969
#endif
7070
}
7171

TODO.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ TODO:
1313
- Separate git and local source options
1414
- Add branch/tag option for git
1515
- Add initialize submodule option for git
16-
- Change "Default" to "DefaultProfile" and "DefaultPlatform"
1716
- Migrate to libyaml
1817
- Add wildcard support for filenames and extensions
1918
- Add tests and examples (On Windows as well)

0 commit comments

Comments
 (0)