Skip to content

Commit

Permalink
nanobind: move content from share/ to lib/
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Mar 21, 2024
1 parent c187a4e commit 3ad1b24
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions recipes/nanobind/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ class PackageConan(ConanFile):

package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
}

@property
def _min_cppstd(self):
Expand All @@ -43,17 +35,12 @@ def _compilers_minimum_version(self):
"Visual Studio": "15",
}

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def layout(self):
cmake_layout(self, src_folder="src")

def package_id(self):
self.info.clear()

def requirements(self):
self.requires("tsl-robin-map/1.2.2")

Expand Down Expand Up @@ -82,16 +69,16 @@ def build(self):

@property
def _cmake_rel_dir(self):
return os.path.join("share", "nanobind", "cmake")
return os.path.join("lib", "nanobind", "cmake")

def package(self):
copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()
rename(self, os.path.join(self.package_folder, "share"), os.path.join(self.package_folder, "lib"))
rename(self,
os.path.join(self.package_folder, self._cmake_rel_dir, "nanobind-config.cmake"),
os.path.join(self.package_folder, self._cmake_rel_dir, "nanobind-conan-config.cmake"))
rm(self, "*.pdb", self.package_folder, recursive=True)

def package_info(self):
self.cpp_info.builddirs = [self._cmake_rel_dir]
Expand Down

0 comments on commit 3ad1b24

Please sign in to comment.