Skip to content

Commit 8a24f44

Browse files
committed
SCons: Fix output with vsproj=yes
1 parent 25de53e commit 8a24f44

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
@@ -1040,9 +1040,9 @@ SConscript("platform/" + env["platform"] + "/SCsub") # Build selected platform.
10401040

10411041
# Microsoft Visual Studio Project Generation
10421042
if env["vsproj"]:
1043+
methods.generate_cpp_hint_file("cpp.hint")
10431044
env["CPPPATH"] = [Dir(path) for path in env["CPPPATH"]]
10441045
methods.generate_vs_project(env, ARGUMENTS, env["vsproj_name"])
1045-
methods.generate_cpp_hint_file("cpp.hint")
10461046

10471047
# Check for the existence of headers
10481048
conf = Configure(env)

methods.py

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

@@ -1034,7 +1045,7 @@ def non_serializable(obj):
10341045
# skip the build process. This lets project files be quickly generated even if there are build errors.
10351046
#
10361047
# To generate AND build from the command line:
1037-
# scons vsproj=yes vsproj_gen_only=yes
1048+
# scons vsproj=yes vsproj_gen_only=no
10381049
def generate_vs_project(env, original_args, project_name="godot"):
10391050
# Augmented glob_recursive that also fills the dirs argument with traversed directories that have content.
10401051
def glob_recursive_2(pattern, dirs, node="."):
@@ -1502,7 +1513,7 @@ def format_key_value(v):
15021513
proj_template = proj_template.replace("%%DEFAULT_ITEMS%%", "\n ".join(all_items))
15031514
proj_template = proj_template.replace("%%PROPERTIES%%", "\n ".join(properties))
15041515

1505-
with open(f"{project_name}.vcxproj", "w", encoding="utf-8", newline="\n") as f:
1516+
with open(f"{project_name}.vcxproj", "w", encoding="utf-8", newline="\r\n") as f:
15061517
f.write(proj_template)
15071518

15081519
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)