Skip to content

Commit

Permalink
only inject conantoolchain.props & conandeps.props
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Dec 31, 2022
1 parent 40d294a commit b4aad0a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions conan/tools/microsoft/msbuild.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import glob
import os

from conans.errors import ConanException
Expand Down Expand Up @@ -49,8 +48,13 @@ def command(self, sln, targets=None):
raise ConanException("targets argument should be a list")
cmd += " /target:{}".format(";".join(targets))

props_paths = ";".join(glob.glob(os.path.join(self._conanfile.generators_folder, "*.props")))
props_paths = []
for props_file in ("conantoolchain.props", "conandeps.props"):
props_path = os.path.exists(os.path.join(self._conanfile.generators_folder, props_file))
if os.path.exists(props_path):
props_paths.append(props_path)
if props_paths:
props_paths = ";".join(props_paths)
cmd += f" /p:ForceImportBeforeCppTargets=\"{props_paths}\""

return cmd
Expand Down

0 comments on commit b4aad0a

Please sign in to comment.