Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions hatch_cpp/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,5 @@ def initialize(self, version: str, build_data: dict[str, t.Any]) -> None:

# force include libraries
for library in libraries:
if build_plan.platform.platform == "win32":
suffix = "dll"
else:
suffix = "so"
build_data["force_include"][f"{library.name}.{suffix}"] = f"{library.name}.{suffix}"
name = library.get_qualified_name(build_plan.platform.platform)
build_data["force_include"][name] = name
9 changes: 9 additions & 0 deletions hatch_cpp/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@
export_symbols: List[str] = Field(default_factory=list, alias="export-symbols")
depends: List[str] = Field(default_factory=list)

def get_qualified_name(self, platform):
if platform == "win32":
suffix = "dll" if self.binding == "none" else "pyd"
elif platform == "darwin" and self.binding == "none":
suffix = "dylib"

Check warning on line 59 in hatch_cpp/structs.py

View check run for this annotation

Codecov / codecov/patch

hatch_cpp/structs.py#L59

Added line #L59 was not covered by tests
else:
suffix = "so"
return f"{self.name}.{suffix}"


class HatchCppPlatform(BaseModel):
cc: str
Expand Down
Loading