Skip to content

Commit 4e5ed0b

Browse files
committed
Merge pull request #93753 from Repiteo/scons/visual-studio-fixes
SCons: Fix output with `vsproj=yes`
2 parents 84af5c1 + 8a24f44 commit 4e5ed0b

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,9 @@ SConscript("platform/" + env["platform"] + "/SCsub") # Build selected platform.
10571057

10581058
# Microsoft Visual Studio Project Generation
10591059
if env["vsproj"]:
1060+
methods.generate_cpp_hint_file("cpp.hint")
10601061
env["CPPPATH"] = [Dir(path) for path in env["CPPPATH"]]
10611062
methods.generate_vs_project(env, ARGUMENTS, env["vsproj_name"])
1062-
methods.generate_cpp_hint_file("cpp.hint")
10631063

10641064
# Check for the existence of headers
10651065
conf = Configure(env)

methods.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,17 @@ def generate_cpp_hint_file(filename):
678678
try:
679679
with open(filename, "w", encoding="utf-8", newline="\n") as fd:
680680
fd.write("#define GDCLASS(m_class, m_inherits)\n")
681+
for name in ["GDVIRTUAL", "EXBIND", "MODBIND"]:
682+
for count in range(13):
683+
for suffix in ["", "R", "C", "RC"]:
684+
fd.write(f"#define {name}{count}{suffix}(")
685+
if "R" in suffix:
686+
fd.write("m_ret, ")
687+
fd.write("m_name")
688+
for idx in range(1, count + 1):
689+
fd.write(f", type{idx}")
690+
fd.write(")\n")
691+
681692
except OSError:
682693
print_warning("Could not write cpp.hint file.")
683694

@@ -1036,7 +1047,7 @@ def non_serializable(obj):
10361047
# skip the build process. This lets project files be quickly generated even if there are build errors.
10371048
#
10381049
# To generate AND build from the command line:
1039-
# scons vsproj=yes vsproj_gen_only=yes
1050+
# scons vsproj=yes vsproj_gen_only=no
10401051
def generate_vs_project(env, original_args, project_name="godot"):
10411052
# Augmented glob_recursive that also fills the dirs argument with traversed directories that have content.
10421053
def glob_recursive_2(pattern, dirs, node="."):
@@ -1504,7 +1515,7 @@ def format_key_value(v):
15041515
proj_template = proj_template.replace("%%DEFAULT_ITEMS%%", "\n ".join(all_items))
15051516
proj_template = proj_template.replace("%%PROPERTIES%%", "\n ".join(properties))
15061517

1507-
with open(f"{project_name}.vcxproj", "w", encoding="utf-8", newline="\n") as f:
1518+
with open(f"{project_name}.vcxproj", "w", encoding="utf-8", newline="\r\n") as f:
15081519
f.write(proj_template)
15091520

15101521
if not get_bool(original_args, "vsproj_props_only", False):

misc/msvs/vcxproj.filters.template

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
<Filter Include="Header Files">
88
<UniqueIdentifier>%%UUID2%%</UniqueIdentifier>
99
</Filter>
10-
<Filter Include="Resource Files">
10+
<Filter Include="Other Files">
1111
<UniqueIdentifier>%%UUID3%%</UniqueIdentifier>
1212
</Filter>
13-
<Filter Include="Scripts">
14-
<UniqueIdentifier>%%UUID4%%</UniqueIdentifier>
15-
</Filter>
1613
%%FILTERS%%
1714
</ItemGroup>
1815
<ItemGroup>

0 commit comments

Comments
 (0)