Skip to content

Commit

Permalink
improve _get_visual_generator
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Dec 6, 2023
1 parent 834a4a7 commit e7eeec9
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions recipes/ginkgo/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,22 @@ def source(self):

def _get_visual_generator(self):
compiler_version = str(self.settings.compiler.version)

if self.settings.compiler == "msvc":
compiler_version = {
"170": "11",
"180": "12",
"190": "14",
"191": "15",
"192": "16",
"193": "17",
}[compiler_version]
toolset_override = self.conf.get("tools.microsoft.msbuild:vs_version", check_type=str)
if toolset_override:
visual_version = toolset_override
else:
visual_version = {
"170": "11",
"180": "12",
"190": "14",
"191": "15",
"192": "16",
"193": "17",
}[compiler_version]
else:
visual_version = compiler_version

visual_gen_suffix = {
"8": "8 2005",
Expand All @@ -123,7 +130,7 @@ def _get_visual_generator(self):
"15": "15 2017",
"16": "16 2019",
"17": "17 2022",
}[compiler_version]
}[visual_version]

return f"Visual Studio {visual_gen_suffix}"

Expand Down

0 comments on commit e7eeec9

Please sign in to comment.