Skip to content

Commit 325b2da

Browse files
WIP
1 parent fd7c5c1 commit 325b2da

32 files changed

+1561
-698
lines changed

CMakeLists.txt

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,40 @@ endif()
5959
# runcpp2
6060
# =========================================================================
6161

62-
add_executable(runcpp2 "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/CompilerInfo.cpp"
63-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/CompilerProfile.cpp"
62+
add_executable(runcpp2 "${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/CompilerInfo.cpp"
63+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/CompilerProfile.cpp"
64+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencyInfo.cpp"
65+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencySearchProperty.cpp"
66+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencySetup.cpp"
67+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/DependencySource.cpp"
68+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/FlagsOverrideInfo.cpp"
69+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/LinkerInfo.cpp"
70+
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/Data/ScriptInfo.cpp"
6471
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/DefaultYAMLs.c"
65-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/DependencyInfo.cpp"
66-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/DependencySource.cpp"
67-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/FlagsOverrideInfo.cpp"
68-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/LinkerInfo.cpp"
6972
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/main.cpp"
7073
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/ParseUtil.cpp"
7174
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/PlatformUtil.cpp"
7275
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/runcpp2.cpp"
73-
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/ScriptInfo.cpp"
7476
"${CMAKE_CURRENT_LIST_DIR}/Src/runcpp2/StringUtil.cpp"
7577
)
7678

7779
target_include_directories(runcpp2 PRIVATE "${CMAKE_CURRENT_LIST_DIR}/Include"
7880
"${CMAKE_CURRENT_LIST_DIR}/External/tinydir"
7981
"${CMAKE_CURRENT_LIST_DIR}/External/cfgpath")
8082

81-
target_link_libraries(runcpp2 PRIVATE CLI11::CLI11 ssLogger yaml-cpp ghc_filesystem)
83+
target_link_libraries(runcpp2 PRIVATE CLI11::CLI11 ssLogger yaml-cpp ghc_filesystem)
84+
85+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
86+
set(STANDARD_COMPILE_FLAGS "/utf-8;/W1")
87+
else()
88+
set(STANDARD_COMPILE_FLAGS "-Wall"
89+
"-Wno-return-local-addr"
90+
"-Wno-sign-compare"
91+
"-Wno-unused-variable"
92+
"-Wno-unused-parameter"
93+
"-Wno-switch"
94+
"-Wno-gnu-zero-variadic-macro-arguments"
95+
"-Wextra"
96+
"-pedantic"
97+
"-Werror")
98+
endif()

DefaultYAMLs/CompilerProfilesSchema.json

Lines changed: 24 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"PreferredProfile":
99
{
1010
"type": "string",
11-
"description": "A default compiler profile to be used if not specified while running the build script"
11+
"description": "A default compiler/linker profile to be used if not specified while running the build script"
1212
},
1313
"CompilerProfiles":
1414
{
1515
"type": "array",
16-
"description": "",
16+
"description": "List of compiler/linker profiles that instruct how to compile/link",
1717
"items":
1818
{
1919
"type": "object",
@@ -32,7 +32,7 @@
3232
"type":"string"
3333
},
3434
"uniqueItems": true,
35-
"description": "The file extensions for the compiler"
35+
"description": "The file extensions associated with the profile"
3636
},
3737
"Languages":
3838
{
@@ -42,7 +42,7 @@
4242
"type":"string"
4343
},
4444
"uniqueItems": true,
45-
"description": "The languages supported by the compiler"
45+
"description": "The languages supported by the profile"
4646
},
4747
"SetupSteps" :
4848
{
@@ -56,46 +56,19 @@
5656
"ObjectFileExtensions":
5757
{
5858
"type": "object",
59-
"properties":
59+
"patternProperties":
6060
{
61-
"Windows": {"type": "string"},
62-
"Linux": {"type": "string"},
63-
"Unix": {"type": "string"},
64-
"MacOS": {"type": "string"}
61+
"^.*$": { "type": "string" }
6562
},
66-
"description": "The file extensions for the object files",
67-
"uniqueItems": true
63+
"additionalProperties": false,
64+
"description": "The file extension for the object files for each platform"
6865
},
6966
"SharedLibraryExtensions":
7067
{
7168
"type": "object",
72-
"properties":
69+
"patternProperties":
7370
{
74-
"Windows":
75-
{
76-
"type": "array",
77-
"items":
78-
{
79-
"type":"string"
80-
}
81-
},
82-
"Linux":
83-
{
84-
"type": "array",
85-
"items":
86-
{
87-
"type":"string"
88-
}
89-
},
90-
"Unix":
91-
{
92-
"type": "array",
93-
"items":
94-
{
95-
"type":"string"
96-
}
97-
},
98-
"MacOS":
71+
"^.*$":
9972
{
10073
"type": "array",
10174
"items":
@@ -104,39 +77,15 @@
10477
}
10578
}
10679
},
107-
"uniqueItems": true,
108-
"description": "The file extensions for the shared libraries"
80+
"additionalProperties": false,
81+
"description": "The file extensions for the shared libraries for each platform"
10982
},
11083
"StaticLibraryExtensions":
11184
{
11285
"type": "object",
113-
"properties":
86+
"patternProperties":
11487
{
115-
"Windows":
116-
{
117-
"type": "array",
118-
"items":
119-
{
120-
"type":"string"
121-
}
122-
},
123-
"Linux":
124-
{
125-
"type": "array",
126-
"items":
127-
{
128-
"type":"string"
129-
}
130-
},
131-
"Unix":
132-
{
133-
"type": "array",
134-
"items":
135-
{
136-
"type":"string"
137-
}
138-
},
139-
"MacOS":
88+
"^.*$":
14089
{
14190
"type": "array",
14291
"items":
@@ -145,39 +94,15 @@
14594
}
14695
}
14796
},
148-
"uniqueItems": true,
149-
"description": "The file extensions for the static libraries"
97+
"additionalProperties": false,
98+
"description": "The file extensions for the static libraries for each platform"
15099
},
151100
"DebugSymbolFileExtensions":
152101
{
153102
"type": "object",
154-
"properties":
103+
"patternProperties":
155104
{
156-
"Windows":
157-
{
158-
"type": "array",
159-
"items":
160-
{
161-
"type":"string"
162-
}
163-
},
164-
"Linux":
165-
{
166-
"type": "array",
167-
"items":
168-
{
169-
"type":"string"
170-
}
171-
},
172-
"Unix":
173-
{
174-
"type": "array",
175-
"items":
176-
{
177-
"type":"string"
178-
}
179-
},
180-
"MacOS":
105+
"^.*$":
181106
{
182107
"type": "array",
183108
"items":
@@ -186,7 +111,7 @@
186111
}
187112
}
188113
},
189-
"uniqueItems": true,
114+
"additionalProperties": false,
190115
"description": "(Optional) The file extensions for debug symbols to be copied alongside the binary"
191116
},
192117
"Compiler":
@@ -216,7 +141,7 @@
216141
"CompileArgs":
217142
{
218143
"type": "string",
219-
"description": "The syntax to compile the given file"
144+
"description": "The syntax to compile the given file. {CompileFlags}, {InputFile}, {ObjectFile} will be replaced accordingly"
220145
}
221146
},
222147
"required":
@@ -230,6 +155,7 @@
230155
"Linker":
231156
{
232157
"type": "object",
158+
"description": "Specify the linker settings, so the final flow will be:\n[Setup steps if any] --> {Executable} {OutputPart} {DependenciesPart}...(for each dependency)",
233159
"properties":
234160
{
235161
"SetupSteps" :
@@ -259,12 +185,12 @@
259185
"OutputPart":
260186
{
261187
"type": "string",
262-
"description": "Syntax for outputting to the binary"
188+
"description": "Syntax for outputting to the binary. {LinkFlags}, {ProgramName} will be replaced accordingly"
263189
},
264190
"DependenciesPart":
265191
{
266192
"type": "string",
267-
"description": "Syntax for linking each dependency"
193+
"description": "Syntax for linking each dependency. {DependencyName} will be replaced accordingly"
268194
}
269195
},
270196
"required":
@@ -280,8 +206,7 @@
280206
"Executable",
281207
"DefaultLinkFlags",
282208
"LinkerArgs"
283-
],
284-
"description": "Specify the linker settings, so the final flow will be:\n[Setup steps if any] --> {Executable} {OutputPart} {DependenciesPart}...(for each dependency)"
209+
]
285210
}
286211
},
287212
"required":
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,78 @@
11
# yaml-language-server: $schema=./CompilerProfilesSchema.json
22

33
---
4+
# A default compiler profile to be used if not specified while running the build script
45
PreferredProfile: "g++"
6+
7+
# List of compiler/linker profiles that instruct how to compile/link
58
CompilerProfiles:
69
- Name: "g++"
10+
11+
# The file extensions associated with the profile
712
FileExtensions: [cpp, cc, cxx]
13+
14+
# The languages supported by the profile
815
Languages: ["c++"]
16+
17+
# (Optional) Steps in commandline to setup the environment
918
SetupSteps: []
19+
20+
# The file extension for the object files for each platform
1021
ObjectFileExtensions:
1122
Windows: obj
1223
Unix: o
24+
25+
# The file extensions for the shared libraries for each platform
1326
SharedLibraryExtensions:
1427
Windows: [dll, lib]
1528
Linux: [so]
1629
MacOS: [dylib]
30+
31+
# The file extensions for the static libraries for each platform
1732
StaticLibraryExtensions:
1833
Windows: [lib]
1934
Unix: [a]
35+
36+
# (Optional) The file extensions for debug symbols to be copied alongside the binary
2037
DebugSymbolFileExtensions:
2138
Windows: []
2239
Unix: []
40+
41+
# Specify the compiler settings, so the final flow will be:
42+
# [Setup steps if any] --> {Executable} {CompileArgs}
2343
Compiler:
44+
# (Optional) Steps in commandline to setup the compiler
2445
SetupSteps: []
46+
47+
# Executable to be called
2548
Executable: "g++"
49+
50+
# Default arguments to provide for compilation which can be overriden by the script
2651
DefaultCompileFlags: "-std=c++17 -Wall -Werror"
52+
53+
# The syntax to compile the given file.
54+
# {CompileFlags}, {InputFile}, {ObjectFile} will be replaced accordingly
2755
CompileArgs: "-c {CompileFlags} {InputFile} -o {ObjectFile}"
56+
57+
# Specify the linker settings, so the final flow will be:
58+
# [Setup steps if any] --> {Executable} {OutputPart} {DependenciesPart}...(for each dependency)
2859
Linker:
60+
# (Optional) Steps in commandline to setup the linker
2961
SetupSteps: []
62+
63+
# Executable to be called
3064
Executable: "g++"
65+
66+
# Default arguments to provide for linking dependencies to the binary,
67+
# which can be overriden by the script
3168
DefaultLinkFlags: ""
69+
70+
# The syntax to link the given file
3271
LinkerArgs:
72+
# Syntax for outputting to the binary.
73+
# {LinkFlags}, {ProgramName} will be replaced accordingly
3374
OutputPart: "{LinkFlags} -o {ProgramName}"
75+
76+
# Syntax for linking each dependency.
77+
# {DependencyName} will be replaced accordingly
3478
DependenciesPart: "-l{DependencyName}"

0 commit comments

Comments
 (0)