Skip to content

Commit

Permalink
Only add LDCXXSHARED flags when building for PyPy + fixed pyproject m…
Browse files Browse the repository at this point in the history
…etadata
  • Loading branch information
sveinbjornt committed Aug 26, 2024
1 parent 25ec942 commit f27d524
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ include src/islenska/resources/compressed.bin
exclude src/islenska/resources/*.csv
exclude src/islenska/resources/*.txt
exclude src/islenska/resources/KRISTINsnid.*
exclude src/islenska/resources/.DS_Store
exclude src/islenska/.DS_Store
exclude src/islenska/*.o
exclude src/islenska/*.so
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "1.0.3"
description = "The vocabulary of modern Icelandic, encapsulated in a Python package"
authors = [{ name = "Miðeind ehf.", email = "[email protected]" }]
maintainers = [{ name = "Miðeind ehf.", email = "[email protected]" }]
readme = { file = "README.rst", content-type = "text/x-rst" }
readme = { file = "README.md", content-type = "text/markdown" }
license = { text = "MIT License" }
keywords = ["nlp", "icelandic", "language", "vocabulary", "dictionary"]
classifiers = [
Expand Down
5 changes: 4 additions & 1 deletion src/islenska/bin_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

WINDOWS = platform.system() == "Windows"
MACOS = platform.system() == "Darwin"
IMPLEMENTATION = platform.python_implementation()

# What follows is the actual Python-wrapped C interface to bin.*.so

Expand All @@ -72,11 +73,13 @@
extra_link_args = []
if MACOS:
extra_link_args = ["-stdlib=libc++", "-mmacosx-version-min=10.9"]
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.9"

# On some systems, the linker needs to be told to use the C++ compiler
# due to changes in the default behaviour of distutils. If absent, the
# package will not build for PyPy.
os.environ["LDCXXSHARED"] = "c++ -shared"
if IMPLEMENTATION == "PyPy":
os.environ["LDCXXSHARED"] = "c++ -shared"

ffibuilder.cdef(declarations) # type: ignore

Expand Down

0 comments on commit f27d524

Please sign in to comment.