Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio: Don't override user options. Add additional vs hint information #88244

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,14 +1380,18 @@ def format_key_value(v):

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
Expand Down
8 changes: 4 additions & 4 deletions misc/msvs/props.template
Original file line number Diff line number Diff line change
Expand Up @@ -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%%
Expand Down
Loading