|
55 | 55 | dpctl_sycl_interface_include = os.environ["DPCTL_SYCL_INTERFACE_INCLDIR"]
|
56 | 56 | sycl_lib = os.environ["ONEAPI_ROOT"] + "\compiler\latest\windows\lib"
|
57 | 57 |
|
| 58 | +# Get long description |
| 59 | +with open("README.md", "r", encoding="utf-8") as file: |
| 60 | + long_description = file.read() |
| 61 | + |
58 | 62 |
|
59 | 63 | def get_sdl_cflags():
|
| 64 | + cflags = [] |
60 | 65 | if IS_LIN or IS_MAC:
|
61 |
| - return [ |
| 66 | + cflags = [ |
62 | 67 | "-fstack-protector",
|
63 | 68 | "-fPIC",
|
64 | 69 | "-D_FORTIFY_SOURCE=2",
|
65 | 70 | "-Wformat",
|
66 | 71 | "-Wformat-security",
|
67 | 72 | ]
|
68 |
| - elif IS_WIN: |
69 |
| - return [] |
| 73 | + # Add cflags from environment |
| 74 | + cflags += os.getenv("CFLAGS", "").split(" ") |
| 75 | + |
| 76 | + return cflags |
70 | 77 |
|
71 | 78 |
|
72 | 79 | def get_sdl_ldflags():
|
| 80 | + ldflags = [] |
73 | 81 | if IS_LIN:
|
74 |
| - return [ |
75 |
| - "-Wl,-z,noexecstack,-z,relro,-z,now", |
76 |
| - ] |
77 |
| - elif IS_MAC: |
78 |
| - return [] |
| 82 | + ldflags = ["-Wl,-z,noexecstack,-z,relro,-z,now"] |
79 | 83 | elif IS_WIN:
|
80 |
| - return ["/NXCompat", "/DynamicBase"] |
| 84 | + ldflags = ["/NXCompat", "/DynamicBase"] |
| 85 | + # Add ldflags from environment |
| 86 | + ldflags += os.getenv("LDFLAGS", "").split(" ") |
| 87 | + |
| 88 | + return ldflags |
81 | 89 |
|
82 | 90 |
|
83 | 91 | def get_other_cxxflags():
|
@@ -237,9 +245,11 @@ def _get_cmdclass():
|
237 | 245 |
|
238 | 246 | setup(
|
239 | 247 | name="dpctl",
|
240 |
| - version=versioneer.get_version(), |
| 248 | + version=versioneer.get_version().split("+")[0], |
241 | 249 | cmdclass=_get_cmdclass(),
|
242 | 250 | description="A lightweight Python wrapper for a subset of OpenCL and SYCL.",
|
| 251 | + long_description=long_description, |
| 252 | + long_description_content_type="text/markdown", |
243 | 253 | license="Apache 2.0",
|
244 | 254 | author="Intel Corporation",
|
245 | 255 | url="https://github.com/IntelPython/dpCtl",
|
|
0 commit comments