Skip to content

Commit 906c190

Browse files
Merge pull request #53 from Neko-Box-Coder/ImportProfile
Adding the ability to reference local YAML for profile
2 parents fd655e5 + 260963d commit 906c190

File tree

16 files changed

+1947
-1439
lines changed

16 files changed

+1947
-1439
lines changed

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,18 @@ if(RUNCPP2_UPDATE_DEFAULT_YAMLS OR EMBEDDED_FILE_SIZE LESS 1024)
111111
message(WARNING "Please build Embed2C first")
112112
return()
113113
else()
114-
set(FILES_TO_EMBED "${CMAKE_CURRENT_LIST_DIR}/DefaultYAMLs/DefaultUserConfig.yaml"
114+
set(FILES_TO_EMBED "${CMAKE_CURRENT_LIST_DIR}/DefaultYAMLs/DefaultUserConfig.yaml"
115115
"DefaultUserConfig"
116+
117+
"${CMAKE_CURRENT_LIST_DIR}/DefaultYAMLs/Default/CommonFileTypes.yaml"
118+
"CommonFileTypes"
119+
120+
"${CMAKE_CURRENT_LIST_DIR}/DefaultYAMLs/Default/g++.yaml"
121+
"G_PlusPlus"
122+
123+
"${CMAKE_CURRENT_LIST_DIR}/DefaultYAMLs/Default/vs2022_v17+.yaml"
124+
"Vs2022_v17Plus"
125+
116126
"${CMAKE_CURRENT_LIST_DIR}/DefaultYAMLs/DefaultScriptInfo.yaml"
117127
"DefaultScriptInfo"
118128
)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# DO NOT modify this file. Changes will be overwritten when there's a reset or update
2+
3+
FilesTypes:
4+
# The file properties for the files to be **linked** as object file for each platform
5+
ObjectLinkFile:
6+
Prefix:
7+
DefaultPlatform: ""
8+
Extension:
9+
Windows: ".obj"
10+
Unix: ".o"
11+
# The file properties for the files to be **linked** as shared libraries for each platform
12+
SharedLinkFile:
13+
Prefix:
14+
Windows: ""
15+
Linux: "lib"
16+
MacOS: ""
17+
Extension:
18+
Windows: ".lib"
19+
Linux: ".so"
20+
MacOS: ".dylib"
21+
# The file properties for the files to be **copied** as shared libraries for each platform
22+
SharedLibraryFile:
23+
Prefix:
24+
Windows: ""
25+
Linux: "lib"
26+
MacOS: ""
27+
Extension:
28+
Windows: ".dll"
29+
Linux: ".so"
30+
MacOS: ".dylib"
31+
# The file properties for the files to be linked as static libraries for each platform
32+
StaticLinkFile:
33+
Prefix:
34+
Unix: "lib"
35+
Windows: ""
36+
Extension:
37+
Windows: ".lib"
38+
Unix: ".a"
39+
# (Optional) The file properties for debug symbols to be copied alongside the binary
40+
# for each platform
41+
DebugSymbolFile:
42+
Prefix:
43+
Windows: ""
44+
Unix: ""
45+
Extension:
46+
Windows: ".pdb"
47+
Unix: ""

DefaultYAMLs/Default/g++.yaml

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
# DO NOT modify this file. Changes will be overwritten when there's a reset or update
2+
3+
# List of anchors that will be aliased later. `Template` is **NOT** part of a profile
4+
Templates:
5+
"g++_CompileRunParts": &g++_CompileRunParts
6+
- Type: Once
7+
CommandPart: "{Executable} -c {CompileFlags}"
8+
- Type: Repeats
9+
CommandPart: " -D{DefineNameOnly}="
10+
- Type: Repeats
11+
CommandPart: " \"-D{DefineName}={DefineValue}\""
12+
- Type: Repeats
13+
CommandPart: " -I\"{IncludeDirectoryPath}\""
14+
- Type: Once
15+
CommandPart: " \"{InputFilePath}\" -o \"{OutputFileDirectory}{/}{ObjectLinkFile.Prefix}{InputFileName}{ObjectLinkFile.Extension}\""
16+
17+
"g++_CompileExpectedOutputFiles": &g++_CompileExpectedOutputFiles
18+
- "{OutputFileDirectory}{/}{ObjectLinkFile.Prefix}{InputFileName}{ObjectLinkFile.Extension}"
19+
20+
# Name (case sensitive) of the profile that can be queried from a script
21+
Name: "g++"
22+
23+
# (Optional) Name aliases (case sensitive) of the current profile
24+
NameAliases: ["mingw"]
25+
26+
# The file extensions associated with the profile
27+
FileExtensions: [.cpp, .cc, .cxx]
28+
29+
# The languages supported by the profile
30+
Languages: ["c++"]
31+
32+
# (Optional) The commands to run in **shell** before calling the compiler/linker for each platform.
33+
# This is run inside the root build directory.
34+
# Setup:
35+
# DefaultPlatform: []
36+
37+
# (Optional) The commands to run in **shell** after calling the compiler/linker for each platform.
38+
# This is run inside the root build directory.
39+
# Cleanup:
40+
# DefaultPlatform: []
41+
42+
# The file properties for the object files for each platform.
43+
# See "./CommonFileTypes.yaml" for FilesTypes
44+
# FilesTypes: ...
45+
46+
# (Optional) We can use the "Import" field to import other yaml files. We are importing "FilesTypes" here.
47+
# Import can either be a single path or a list of paths.
48+
# All the fields in the imported yaml files will be merged together
49+
Import: "./CommonFileTypes.yaml"
50+
51+
# Specify the compiler settings
52+
Compiler:
53+
# (Optional) The command to be prepend for each compile command in **shell** for each platform
54+
# PreRun:
55+
# DefaultPlatform: ""
56+
57+
# Shell command to use for checking if the executable exists or not
58+
CheckExistence:
59+
DefaultPlatform: "g++ -v"
60+
61+
# Here are a list of substitution strings for RunParts, Setup and Cleanup.
62+
# To escape '{' and '}' to avoid substitutioon, simply repeat the '{' or '}' character again.
63+
# So "${MyBashVariable}" will become "${{MyBashVariable}}"
64+
65+
# {Executable}: Compiler executable
66+
# {CompileFlags}: Compile flags from config and override
67+
# {InputFileName}: Name of the input file (without directory path and extension)
68+
# {InputFileExtension}: Extension of the input file
69+
# {InputFileDirectory}: Directory of the input file
70+
# {InputFilePath}: Full path to the input file
71+
# {OutputFileDirectory}: Directory of all the output files
72+
# {/}: Filesystem separator for the host platform
73+
74+
# {SharedLibraryFile.Prefix}
75+
# {SharedLinkFile.Prefix}
76+
# {StaticLinkFile.Prefix}
77+
# {ObjectLinkFile.Prefix}
78+
# {DebugSymbolFile.Prefix}
79+
80+
# {SharedLibraryFile.Extension}
81+
# {SharedLinkFile.Extension}
82+
# {StaticLinkFile.Extension}
83+
# {ObjectLinkFile.Extension}
84+
# {DebugSymbolFile.Extension}
85+
86+
# Below are iterable substitution strings, must be inside "Repeats" run type:
87+
# {IncludeDirectoryPath}: Path to all the include directories
88+
# {DefineNameOnly}: All the defines without a value specified (equivalent to #define X)
89+
# {DefineName}: Name of all the defines that has a value specified
90+
# {DefineValue}: Value of all the defines that has a value specified (use together with {DefineName})
91+
CompileTypes:
92+
Executable:
93+
DefaultPlatform:
94+
# Default flags to be substituted as {CompileFlags}
95+
Flags: "-std=c++17 -Wall -g"
96+
97+
# The executable to be substituted as {Executable}
98+
Executable: "g++"
99+
100+
# The components for the command to be run
101+
RunParts: *g++_CompileRunParts
102+
103+
# What files to be expected as output for the command
104+
ExpectedOutputFiles: *g++_CompileExpectedOutputFiles
105+
106+
# (Optional) The commands to run in **shell** BEFORE compiling
107+
# This is run inside the .runcpp2 directory where the build happens.
108+
# Setup: []
109+
110+
# (Optional) The commands to run in **shell** AFTER compiling
111+
# This is run inside the .runcpp2 directory where the build happens.
112+
# Cleanup: []
113+
ExecutableShared:
114+
DefaultPlatform:
115+
Flags: "-std=c++17 -Wall -g -fpic"
116+
Executable: "g++"
117+
RunParts: *g++_CompileRunParts
118+
ExpectedOutputFiles: *g++_CompileExpectedOutputFiles
119+
# Setup: []
120+
# Cleanup: []
121+
Static:
122+
DefaultPlatform:
123+
Flags: "-std=c++17 -Wall -g"
124+
Executable: "g++"
125+
RunParts: *g++_CompileRunParts
126+
ExpectedOutputFiles: *g++_CompileExpectedOutputFiles
127+
# Setup: []
128+
# Cleanup: []
129+
Shared:
130+
DefaultPlatform:
131+
Flags: "-std=c++17 -Wall -g -fpic"
132+
Executable: "g++"
133+
RunParts: *g++_CompileRunParts
134+
ExpectedOutputFiles: *g++_CompileExpectedOutputFiles
135+
# Setup: []
136+
# Cleanup: []
137+
138+
# Specify the linker settings
139+
Linker:
140+
CheckExistence:
141+
DefaultPlatform: "g++ -v"
142+
143+
# Here are a list of substitution strings for RunParts, Setup and Cleanup
144+
# {Executable}: Linker executable
145+
# {LinkFlags}: Link flags from config and override
146+
# {OutputFileName}: Name of all the output files (without directory path and extension)
147+
# {OutputFileDirectory}: Directory of all the output files
148+
# {/}: Filesystem separator for the host platform
149+
150+
# {SharedLibraryFile.Prefix}
151+
# {SharedLinkFile.Prefix}
152+
# {StaticLinkFile.Prefix}
153+
# {ObjectLinkFile.Prefix}
154+
# {DebugSymbolFile.Prefix}
155+
156+
# {SharedLibraryFile.Extension}
157+
# {SharedLinkFile.Extension}
158+
# {StaticLinkFile.Extension}
159+
# {ObjectLinkFile.Extension}
160+
# {DebugSymbolFile.Extension}
161+
162+
# Below are iterable substitution strings, must be inside "Repeats" run type:
163+
# {LinkFileName}: Name of the file to be linked, regardless of the build type
164+
# {LinkFileExtension}: File Extension of the file to be linked, regardless of the build type
165+
# {LinkFileDirectory}: Directory of the file to be linked, regardless of the build type
166+
# {LinkFilePath}: Full path to the file to be linked, regardless of the build type
167+
168+
# {LinkObjectFileName}: Name of the object file to be linked
169+
# {LinkObjectFileExtension}: File Extension of the object file to be linked
170+
# {LinkObjectFileDirectory}: Directory of the object file to be linked
171+
# {LinkObjectFilePath}: Full path to the object file to be linked
172+
173+
# {LinkSharedFileName}: Name of the shared file to be linked
174+
# {LinkSharedFileExtension}: File Extension of the shared file to be linked
175+
# {LinkSharedFileDirectory}: Directory of the shared file to be linked
176+
# {LinkSharedFilePath}: Full path to the shared file to be linked
177+
178+
# {LinkStaticFileName}: Name of the static file to be linked
179+
# {LinkStaticFileExtension}: File Extension of the static file to be linked
180+
# {LinkStaticFileDirectory}: Directory of the static file to be linked
181+
# {LinkStaticFilePath}: Full path to the static file to be linked
182+
LinkTypes:
183+
Executable:
184+
Unix:
185+
Flags: "-Wl,-rpath,\\$ORIGIN"
186+
Executable: "g++"
187+
RunParts:
188+
- Type: Once
189+
CommandPart: "{Executable} {LinkFlags} -o \"{OutputFileDirectory}{/}{OutputFileName}\""
190+
- Type: Repeats
191+
CommandPart: " \"{LinkFilePath}\""
192+
ExpectedOutputFiles: ["{OutputFileDirectory}{/}{OutputFileName}"]
193+
# Setup: []
194+
# Cleanup: []
195+
Windows:
196+
Flags: "-Wl,-rpath,\\$ORIGIN"
197+
Executable: "g++"
198+
RunParts:
199+
- Type: Once
200+
CommandPart: "{Executable} {LinkFlags} -o \"{OutputFileDirectory}{/}{OutputFileName}.exe\""
201+
- Type: Repeats
202+
CommandPart: " \"{LinkFilePath}\""
203+
ExpectedOutputFiles: ["{OutputFileDirectory}{/}{OutputFileName}.exe"]
204+
# Setup: []
205+
# Cleanup: []
206+
ExecutableShared:
207+
DefaultPlatform:
208+
Flags: "-shared -Wl,-rpath,\\$ORIGIN"
209+
Executable: "g++"
210+
RunParts:
211+
- Type: Once
212+
CommandPart: "{Executable} {LinkFlags} -o \"{OutputFileDirectory}{/}{SharedLibraryFile.Prefix}{OutputFileName}{SharedLibraryFile.Extension}\""
213+
- Type: Repeats
214+
CommandPart: " \"{LinkFilePath}\""
215+
ExpectedOutputFiles: ["{OutputFileDirectory}{/}{SharedLibraryFile.Prefix}{OutputFileName}{SharedLibraryFile.Extension}"]
216+
# Setup: []
217+
# Cleanup: []
218+
Static:
219+
DefaultPlatform:
220+
Flags: ""
221+
Executable: "g++"
222+
RunParts:
223+
- Type: Once
224+
CommandPart: "{Executable} {LinkFlags} -o \"{OutputFileDirectory}{/}{StaticLinkFile.Prefix}{OutputFileName}{StaticLinkFile.Extension}\""
225+
- Type: Repeats
226+
CommandPart: " \"{LinkFilePath}\""
227+
ExpectedOutputFiles: ["{OutputFileDirectory}{/}{StaticLinkFile.Prefix}{OutputFileName}{StaticLinkFile.Extension}"]
228+
# Setup: []
229+
# Cleanup: []
230+
Shared:
231+
DefaultPlatform:
232+
Flags: "-shared -Wl,-rpath,\\$ORIGIN"
233+
Executable: "g++"
234+
RunParts:
235+
- Type: Once
236+
CommandPart: "{Executable} {LinkFlags} -o \"{OutputFileDirectory}{/}{SharedLibraryFile.Prefix}{OutputFileName}{SharedLibraryFile.Extension}\""
237+
- Type: Repeats
238+
CommandPart: " \"{LinkFilePath}\""
239+
ExpectedOutputFiles: ["{OutputFileDirectory}{/}{SharedLibraryFile.Prefix}{OutputFileName}{SharedLibraryFile.Extension}"]
240+
# Setup: []
241+
# Cleanup: []

0 commit comments

Comments
 (0)