summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-04-08 11:19:58 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-04-08 11:19:58 +0200
commit1f71d491d08380baf270334149b36858dbf38f9d (patch)
treebcd7ea60ca5938cf9bff511852712e1be4c036e4
parent2fb6f7f31aabf50dc4d24ef12786f1811f0ef44b (diff)
parent1c7167e9ac9156e05b25d6b1399c6535e5666018 (diff)
downloadredot-engine-1f71d491d08380baf270334149b36858dbf38f9d.tar.gz
Merge pull request #88244 from shana/vs-improve-settings
Visual Studio: Don't override user options. Add additional vs hint information
-rw-r--r--methods.py20
-rw-r--r--misc/msvs/props.template8
2 files changed, 16 insertions, 12 deletions
diff --git a/methods.py b/methods.py
index e65d2757bd..fa7db95e92 100644
--- a/methods.py
+++ b/methods.py
@@ -1452,14 +1452,18 @@ def generate_vs_project(env, original_args, project_name="godot"):
props_template = props_template.replace("%%OUTPUT%%", output)
- props_template = props_template.replace(
- "%%DEFINES%%", ";".join([format_key_value(v) for v in list(env["CPPDEFINES"])])
- )
- props_template = props_template.replace("%%INCLUDES%%", ";".join([str(j) for j in env["CPPPATH"]]))
- props_template = props_template.replace(
- "%%OPTIONS%%",
- " ".join(env["CCFLAGS"]) + " " + " ".join([x for x in env["CXXFLAGS"] if not x.startswith("$")]),
- )
+ proplist = [format_key_value(v) for v in list(env["CPPDEFINES"])]
+ proplist += [format_key_value(j) for j in env.get("VSHINT_DEFINES", [])]
+ props_template = props_template.replace("%%DEFINES%%", ";".join(proplist))
+
+ proplist = [str(j) for j in env["CPPPATH"]]
+ proplist += [str(j) for j in env.get("VSHINT_INCLUDES", [])]
+ props_template = props_template.replace("%%INCLUDES%%", ";".join(proplist))
+
+ proplist = env["CCFLAGS"]
+ proplist += [x for x in env["CXXFLAGS"] if not x.startswith("$")]
+ proplist += [str(j) for j in env.get("VSHINT_OPTIONS", [])]
+ props_template = props_template.replace("%%OPTIONS%%", " ".join(proplist))
# Windows allows us to have spaces in paths, so we need
# to double quote off the directory. However, the path ends
diff --git a/misc/msvs/props.template b/misc/msvs/props.template
index 8facaf7f36..f360871b72 100644
--- a/misc/msvs/props.template
+++ b/misc/msvs/props.template
@@ -4,13 +4,13 @@
<NMakeBuildCommandLine>%%BUILD%%</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>%%REBUILD%%</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>%%CLEAN%%</NMakeCleanCommandLine>
- <NMakeOutput>%%OUTPUT%%</NMakeOutput>
- <NMakePreprocessorDefinitions>%%DEFINES%%</NMakePreprocessorDefinitions>
- <NMakeIncludeSearchPath>%%INCLUDES%%</NMakeIncludeSearchPath>
+ <NMakeOutput Condition="'$(NMakeOutput)' == ''">%%OUTPUT%%</NMakeOutput>
+ <NMakePreprocessorDefinitions>%%DEFINES%%;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath>%%INCLUDES%%;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
<NMakeForcedIncludes>$(NMakeForcedIncludes)</NMakeForcedIncludes>
<NMakeAssemblySearchPath>$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
<NMakeForcedUsingAssemblies>$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
- <AdditionalOptions>%%OPTIONS%%</AdditionalOptions>
+ <AdditionalOptions>%%OPTIONS%% $(AdditionalOptions)</AdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition="%%CONDITION%%">
%%PROPERTIES%%