Skip to content

Commit 4de0f1b

Browse files
committed
Merge pull request #107709 from shana/shana/vs-module-defines
Add module defines to the per-platform generated props file so VS knows which ones are enabled.
2 parents c7d2ea4 + 87a7c1d commit 4de0f1b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

methods.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,11 @@ def get_dependencies(file, env, exts, headers, sources, others):
12931293
)
12941294
output = os.path.join("bin", f"godot{env['PROGSUFFIX']}")
12951295

1296+
# The modules_enabled.gen.h header containing the defines is only generated on build, and only for the most recently built
1297+
# platform, which means VS can't properly render code that's inside module-specific ifdefs. This adds those defines to the
1298+
# platform-specific VS props file, so that VS knows which defines are enabled for the selected platform.
1299+
env.Append(VSHINT_DEFINES=[f"MODULE_{module.upper()}_ENABLED" for module in env.module_list])
1300+
12961301
with open("misc/msvs/props.template", "r", encoding="utf-8") as file:
12971302
props_template = file.read()
12981303

0 commit comments

Comments
 (0)