Skip to content

Commit

Permalink
small_gicp: llvm-openmp is required for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jul 8, 2024
1 parent b4f803f commit fa85ac2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions recipes/small_gicp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ def layout(self):

def requirements(self):
self.requires("eigen/3.4.0", transitive_headers=True)
if not is_msvc(self):
# '#pragma omp' is used in public headers
self.requires("llvm-openmp/17.0.6", transitive_headers=True, transitive_libs=True)
# '#pragma omp' is used in public headers
# Note: native MSVC OpenMP is not compatible
self.requires("llvm-openmp/17.0.6", transitive_headers=True, transitive_libs=True)
if self.options.with_tbb:
self.requires("onetbb/2021.12.0", transitive_headers=True, transitive_libs=True)
# The project vendors nanoflann, but it has been heavily extended and should be kept intact
# Also uses some fragments from Sophus

def validate(self):
if self.settings.compiler.cppstd:
Expand Down Expand Up @@ -128,7 +129,7 @@ def _openmp_flags(self):
elif self.settings.compiler == "sun-cc":
return ["-xopenmp"]
if is_msvc(self):
return ["-openmp"]
return ["-openmp:llvm"]
return None

def package_info(self):
Expand All @@ -147,3 +148,5 @@ def package_info(self):
self.cpp_info.system_libs.extend(["dl", "pthread", "rt"])
self.cpp_info.cflags = self._openmp_flags
self.cpp_info.cxxflags = self._openmp_flags
self.cpp_info.sharedlinkflags = self._openmp_flags
self.cpp_info.exelinkflags = self._openmp_flags

0 comments on commit fa85ac2

Please sign in to comment.