Skip to content

Commit

Permalink
mpir: get rid of vs_ide_version() use
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Oct 25, 2023
1 parent 5aec8b5 commit 7f2ff3d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions recipes/mpir/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from conan.tools.gnu import Autotools, AutotoolsToolchain
from conan.tools.layout import basic_layout
from conan.tools.microsoft import MSBuild, MSBuildToolchain, is_msvc, is_msvc_static_runtime, msvc_runtime_flag
from conan.tools.microsoft.visual import vs_ide_version
from conan.tools.scm import Version

Check warning on line 12 in recipes/mpir/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Unused Version imported from conan.tools.scm

required_conan_version = ">=1.53.0"
Expand Down Expand Up @@ -122,10 +121,16 @@ def _platforms(self):
def _dll_or_lib(self):
return "dll" if self.options.shared else "lib"

@property
def _vs_ide_version(self):
if str(self.settings.compiler) == "Visual Studio":
return self.settings.compiler.version
msvc_to_ide = {"170": "11", "180": "12", "190": "14", "191": "15", "192": "16", "193": "17"}
return msvc_to_ide.get(str(self.settings.compiler.version), "17")

@property
def _vcxproj_paths(self):
compiler_version = self.settings.compiler.version if Version(vs_ide_version(self)) <= "17" else "17"
build_subdir = f"build.vc{compiler_version}"
build_subdir = f"build.vc{self._vs_ide_version}"
vcxproj_paths = [
os.path.join(self.source_folder, build_subdir, f"{self._dll_or_lib}_mpir_gc", f"{self._dll_or_lib}_mpir_gc.vcxproj")
]
Expand Down

0 comments on commit 7f2ff3d

Please sign in to comment.