Commit f72dcb54 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

fix cross-compile windows python3.8

parent 59a9f505
Pipeline #9877 failed with stages
in 4 minutes and 26 seconds
......@@ -32,7 +32,7 @@ seamshbuild-windows :
image : immc/seamsh-build:v0.9
stage : build
script:
- CC=x86_64-w64-mingw32-gcc python3 setup.py bdist_wheel --plat-name=win_amd64
- LDSHARED="x86_64-w64-mingw32-gcc" LDFLAGS="-fstack-protector-strong -shared -O2" CC=x86_64-w64-mingw32-gcc python3 setup.py bdist_wheel --plat-name=win_amd64
artifacts:
paths:
- dist
......
......@@ -19,6 +19,7 @@
# see <http://www.gnu.org/licenses/>.
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
import pkg_resources
import sys
......@@ -32,9 +33,6 @@ commit_tag = os.environ.get("CI_COMMIT_TAG")
if commit_tag and (commit_tag.startswith("v-") or commit_tag.startswith("w-")):
version = commit_tag[2:]
lib_ext = {"linux-x86_64":".so"}[pkg_resources.get_platform()]
os.environ["SETUPTOOLS_EXT_SUFFIX"] = lib_ext
lib = Extension("seamsh.libseamsh", sources = ["seamshlib/seamsh.c","seamshlib/polymesh.c","seamshlib/robustPredicates.c"])
class bdist_wheel(_bdist_wheel):
......@@ -42,6 +40,11 @@ class bdist_wheel(_bdist_wheel):
otag = _bdist_wheel.get_tag(self)
return ("py3", "none", otag[2])
class build_ext(_build_ext):
def get_ext_filename(self, fullname):
filename = os.path.join(*fullname.split('.')) + ".so"
return filename
setup(
name="seamsh",
version=version,
......@@ -55,8 +58,8 @@ setup(
packages=["seamsh"],
ext_modules = [lib],
package_dir={"seamsh":"seamsh"},
cmdclass = {'bdist_wheel':bdist_wheel},
package_data={"seamsh":["*.so","*.dll","*.dll.a","*.dylib","COPYING.txt","AUTHORS.txt","LICENSE.txt"]},
cmdclass = {'bdist_wheel':bdist_wheel,"build_ext":build_ext},
package_data={"seamsh":["*.so","COPYING.txt","AUTHORS.txt","LICENSE.txt"]},
classifiers=[
"Environment :: Console",
"Development Status :: 4 - Beta",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment