Skip to content

Commit b4aad0a

Browse files
committed
only inject conantoolchain.props & conandeps.props
1 parent 40d294a commit b4aad0a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

conan/tools/microsoft/msbuild.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import glob
21
import os
32

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

52-
props_paths = ";".join(glob.glob(os.path.join(self._conanfile.generators_folder, "*.props")))
51+
props_paths = []
52+
for props_file in ("conantoolchain.props", "conandeps.props"):
53+
props_path = os.path.exists(os.path.join(self._conanfile.generators_folder, props_file))
54+
if os.path.exists(props_path):
55+
props_paths.append(props_path)
5356
if props_paths:
57+
props_paths = ";".join(props_paths)
5458
cmd += f" /p:ForceImportBeforeCppTargets=\"{props_paths}\""
5559

5660
return cmd

0 commit comments

Comments
 (0)