Skip to content

Commit 8228be5

Browse files
committed
Add project setup wizard dialog
1 parent 3bf9dd0 commit 8228be5

File tree

13 files changed

+1210
-1
lines changed

13 files changed

+1210
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ local.properties
2020
/toolkit/src/gen/
2121
compile_commands.json
2222

23+
# Generated files
24+
*.gen.h
25+
2326
# Binaries
2427
*.o
2528
*.os

SConstruct

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ meta_platform_sdk_bindings = env.MetaPlatformSDK(env.Dir('#toolkit/gen/'), sourc
1818
"generate_platform_sdk_bindings.py",
1919
])
2020

21+
from build_raw_headers import build_raw_headers_action
22+
env.Append(
23+
BUILDERS={
24+
"RawHeaders": Builder(action=build_raw_headers_action),
25+
})
26+
raw_headers = env.RawHeaders(
27+
target=[
28+
'#toolkit/src/main/cpp/include/raw_headers/mr_startup.tscn.gen.h',
29+
'#toolkit/src/main/cpp/include/raw_headers/start_mr.gd.gen.h',
30+
'#toolkit/src/main/cpp/include/raw_headers/start_vr.gd.gen.h',
31+
'#toolkit/src/main/cpp/include/raw_headers/vr_startup.tscn.gen.h',
32+
],
33+
source=[
34+
'#toolkit/src/main/cpp/include/raw_headers/mr_startup.tscn',
35+
'#toolkit/src/main/cpp/include/raw_headers/start_mr.gd',
36+
'#toolkit/src/main/cpp/include/raw_headers/start_vr.gd',
37+
'#toolkit/src/main/cpp/include/raw_headers/vr_startup.tscn',
38+
],
39+
)
40+
2141
# Add common includes.
2242
env.Append(CPPPATH=[
2343
"#thirdparty/ovr_platform_sdk/Include/",
@@ -68,6 +88,7 @@ else:
6888
source=sources,
6989
)
7090

91+
env.Depends(library, raw_headers)
7192
Default(library)
7293

7394
if env["platform"] == "android":

build_raw_headers.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
3+
def build_raw_header(source_filename: str, constant_name: str) -> None:
4+
# Read the source file content.
5+
with open(source_filename, "r") as source_file:
6+
source_content = source_file.read()
7+
constant_name = constant_name.replace(".", "_")
8+
# Build header content using a C raw string literal.
9+
header_content = (
10+
"/* THIS FILE IS GENERATED. EDITS WILL BE LOST. */\n\n"
11+
"#pragma once\n\n"
12+
f"inline constexpr const char *{constant_name}"
13+
" = "
14+
f'R"<!>({source_content})<!>"'
15+
";\n"
16+
)
17+
# Write the header to the provided file name with a ".gen.h" suffix.
18+
header_filename = f"{source_filename}.gen.h"
19+
with open(header_filename, "w") as header_file:
20+
header_file.write(header_content)
21+
22+
def build_raw_headers_action(target, source, env):
23+
env.NoCache(target)
24+
for src in source:
25+
source_filename = str(src)
26+
constant_name = os.path.basename(source_filename)
27+
build_raw_header(source_filename, constant_name)

thirdparty/godot_cpp_build_profile/build_profile.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
"BoxContainer",
66
"Button",
77
"CanvasItem",
8+
"ConfigFile",
89
"ConfirmationDialog",
910
"Container",
1011
"Control",
12+
"DirAccess",
1113
"EditorExportPlatform",
1214
"EditorExportPlatformAndroid",
1315
"EditorExportPlugin",
@@ -21,19 +23,23 @@
2123
"Label",
2224
"LineEdit",
2325
"MainLoop",
26+
"MarginContainer",
2427
"Node",
28+
"OptionButton",
2529
"OS",
30+
"PanelContainer",
2631
"ProjectSettings",
2732
"RefCounted",
2833
"Resource",
2934
"RichTextLabel",
3035
"ScrollContainer",
3136
"Shortcut",
37+
"Theme",
3238
"TextServer",
3339
"Texture",
3440
"Texture2D",
3541
"VBoxContainer",
3642
"Viewport",
3743
"Window"
3844
]
39-
}
45+
}

0 commit comments

Comments
 (0)