Skip to content

Commit

Permalink
mdspan: Set supported MSVC versions
Browse files Browse the repository at this point in the history
The upstream has a build issues with certain MSVC versions.
See kokkos/mdspan#26 for details.
  • Loading branch information
leha-bot committed Aug 3, 2022
1 parent 4a1d26b commit 02bbdd2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions recipes/mdspan/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ def _minimum_compilers_version(self):
"apple-clang": "5.1"
}

def _is_msvc(self, compiler_name):
return compiler_name == "Visual Studio"

# According to upstream issue https://github.com/kokkos/mdspan/issues/26 , the MSVC updates to STL has broke the build
# since MSVC 16.6; and seems it built successfully on MSVC 17
def _msvc_is_supported_version(self, version):
return version < "16.6" or version >= "17.0"


def configure(self):
if self.settings.compiler.get_safe("cppstd"):
tools.check_min_cppstd(self, self._minimum_cpp_standard)
Expand All @@ -49,6 +58,11 @@ def configure(self):
self.name, self._minimum_cpp_standard,
self.settings.compiler,
self.settings.compiler.version))
if self._is_msvc(str(self.settings.compiler)) and not self._msvc_is_supported_version(tools.Version(self.settings.compiler.version)):
raise ConanInvalidConfiguration(
"Unsupported MSVC version {} due to upstream bug. The supported MSVC versions are > 15.0 and < 16.6 or >= 17.0."
"See upstream issue https://github.com/kokkos/mdspan/issues/26 for details.", tools.Version(self.settings.compiler.version))


def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder)
Expand Down

0 comments on commit 02bbdd2

Please sign in to comment.