Skip to content

Commit 99082f7

Browse files
General Setup and EnvironmentSetup implementations
1 parent 2ddcb34 commit 99082f7

File tree

11 files changed

+311
-41
lines changed

11 files changed

+311
-41
lines changed

DefaultYAMLs/DefaultScriptInfo.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RequiredProfiles:
1212

1313
# (Optional) Override the default compile flags
1414
OverrideCompileFlags:
15-
# Applies to all platforms (Can be Linux, MacOS, Windows, Unix, etc.)
15+
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
1616
All:
1717
# Profile with the respective flags to override
1818
"g++":
@@ -25,7 +25,7 @@ OverrideCompileFlags:
2525

2626
# (Optional) Override the default link flags
2727
OverrideLinkFlags:
28-
# Applies to all platforms
28+
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
2929
All:
3030
# Profile with the respective flags to override
3131
"g++":
@@ -70,12 +70,13 @@ Dependencies:
7070

7171
# (Optional) Additional link options for this dependency
7272
AdditionalLinkOptions:
73+
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
7374
All: []
7475

7576

7677
# (Optional) List of setup commands for the supported platforms
7778
Setup:
78-
# Setup commands for the specified platform
79+
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
7980
All:
8081
# Setup commands for the specified profile.
8182
# All commands are run in the dependency folder

DefaultYAMLs/DefaultUserConfig.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ CompilerProfiles:
1414
# The languages supported by the profile
1515
Languages: ["c++"]
1616

17-
# (Optional) Steps in commandline to setup the environment
18-
SetupSteps: []
17+
# (Optional) Steps to run before calling the compiler/linker.
18+
# This is run inside the .runcpp2 directory where the build happens.
19+
SetupSteps:
20+
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
21+
All: []
1922

2023
# The file extension for the object files for each platform
2124
ObjectFileExtensions:
@@ -41,8 +44,10 @@ CompilerProfiles:
4144
# Specify the compiler settings, so the final flow will be:
4245
# [Setup steps if any] --> {Executable} {CompileArgs}
4346
Compiler:
44-
# (Optional) Steps in commandline to setup the compiler
45-
SetupSteps: []
47+
# (Optional) The command to run together before running each compile command
48+
EnvironmentSetup:
49+
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
50+
All: ""
4651

4752
# Executable to be called
4853
Executable: "g++"
@@ -63,8 +68,10 @@ CompilerProfiles:
6368
# Specify the linker settings, so the final flow will be:
6469
# [Setup steps if any] --> {Executable} {OutputPart} {DependenciesPart}...(for each dependency)
6570
Linker:
66-
# (Optional) Steps in commandline to setup the linker
67-
SetupSteps: []
71+
# (Optional) The command to run together before running each link command
72+
EnvironmentSetup:
73+
# Applies to all platforms (Can be changed to Linux, MacOS, Windows, Unix, etc.)
74+
All: ""
6875

6976
# Executable to be called
7077
Executable: "g++"

DefaultYAMLs/UserConfigSchema.json

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@
2828
},
2929
"SetupSteps" :
3030
{
31-
"type": "array",
32-
"items": { "type":"string" }
31+
"type": "object",
32+
"patternProperties":
33+
{
34+
"^.*$":
35+
{
36+
"type": "array",
37+
"items": { "type":"string" }
38+
}
39+
},
40+
"additionalProperties": false
3341
},
3442
"ObjectFileExtensions":
3543
{
@@ -86,8 +94,16 @@
8694
{
8795
"SetupSteps" :
8896
{
89-
"type": "array",
90-
"items": { "type":"string" }
97+
"type": "object",
98+
"patternProperties":
99+
{
100+
"^.*$":
101+
{
102+
"type": "array",
103+
"items": { "type":"string" }
104+
}
105+
},
106+
"additionalProperties": false
91107
},
92108
"Executable": { "type": "string" },
93109
"DefaultCompileFlags": { "type": "string" },
@@ -124,8 +140,16 @@
124140
{
125141
"SetupSteps" :
126142
{
127-
"type": "array",
128-
"items": { "type":"string" }
143+
"type": "object",
144+
"patternProperties":
145+
{
146+
"^.*$":
147+
{
148+
"type": "array",
149+
"items": { "type":"string" }
150+
}
151+
},
152+
"additionalProperties": false
129153
},
130154
"Executable": { "type": "string" },
131155
"DefaultLinkFlags": { "type": "string" },

Include/runcpp2/Data/CompilerInfo.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#ifndef RUNCPP2_DATA_COMPILER_INFO_HPP
22
#define RUNCPP2_DATA_COMPILER_INFO_HPP
33

4+
#include "runcpp2/Data/ParseCommon.hpp"
45
#include "ryml.hpp"
56

7+
#include <vector>
68
#include <string>
9+
#include <unordered_map>
710

811
namespace runcpp2
912
{
@@ -12,6 +15,7 @@ namespace runcpp2
1215
class CompilerInfo
1316
{
1417
public:
18+
std::unordered_map<PlatformName, std::string> EnvironmentSetup;
1519
std::string Executable;
1620
std::string DefaultCompileFlags;
1721

@@ -25,7 +29,7 @@ namespace runcpp2
2529

2630
Args CompileArgs;
2731

28-
bool ParseYAML_Node(ryml::ConstNodeRef& profileNode);
32+
bool ParseYAML_Node(ryml::ConstNodeRef& node);
2933
std::string ToString(std::string indentation) const;
3034
};
3135
}

Include/runcpp2/Data/CompilerProfile.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace runcpp2
2222
std::string Name;
2323
std::unordered_set<std::string> FileExtensions;
2424
std::unordered_set<std::string> Languages;
25-
std::vector<std::string> SetupSteps;
25+
std::unordered_map<PlatformName, std::vector<std::string>> SetupSteps;
2626
std::unordered_map<PlatformName, std::string> ObjectFileExtensions;
2727
std::unordered_map<PlatformName, std::vector<std::string>> SharedLibraryExtensions;
2828
std::unordered_map<PlatformName, std::vector<std::string>> StaticLibraryExtensions;

Include/runcpp2/Data/LinkerInfo.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#ifndef RUNCPP2_DATA_LINKER_INFO_HPP
22
#define RUNCPP2_DATA_LINKER_INFO_HPP
33

4+
#include "runcpp2/Data/ParseCommon.hpp"
45
#include "ryml.hpp"
6+
7+
#include <vector>
58
#include <string>
9+
#include <unordered_map>
610

711
namespace runcpp2
812
{
@@ -11,6 +15,7 @@ namespace runcpp2
1115
class LinkerInfo
1216
{
1317
public:
18+
std::unordered_map<PlatformName, std::string> EnvironmentSetup;
1419
std::string Executable;
1520
std::string DefaultLinkFlags;
1621

0 commit comments

Comments
 (0)