-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path_msbuild.py
65 lines (58 loc) · 2.01 KB
/
_msbuild.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import os
from pathlib import Path
from pymsbuild import *
from pymsbuild.cython import *
VERSION = os.getenv("BUILD_BUILDNUMBER", "0.0.1")
GHREF = os.getenv("GITHUB_REF")
if GHREF:
VERSION = GHREF.rpartition("/")[2]
METADATA = {
"Metadata-Version": "2.1",
"Name": "dlltracer",
"Version": VERSION,
"Author": "Microsoft Corporation",
"Author-email": "[email protected]",
"Home-page": "https://github.com/microsoft/dlltracer-python",
"Project-url": [
"Bug Tracker, https://github.com/microsoft/dlltracer-python/issues",
],
"Summary": "Python module for tracing Windows DLL loads",
"Description": File("README.md"),
"Description-Content-Type": "text/markdown",
"Keywords": "Windows,Win32,DLL",
"Classifier": [
"Development Status :: 5 - Production/Stable",
"Environment :: Win32 (MS Windows)",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
"Requires-Python": ">=3.7",
}
AUDIT_STUB = CSourceFile("dlltracer/audit_stub.c")
PYD = CythonPydFile(
"_native",
ItemDefinition("ClCompile",
AdditionalIncludeDirectories=ConditionalValue(Path("src;").absolute(), prepend=True)
),
ItemDefinition("Link",
GenerateDebugInformation=ConditionalValue("false", condition="$(Configuration) == 'Release'")),
PyxFile("dlltracer/_native.pyx", TargetExt=".cpp"),
IncludeFile("dlltracer/audit_stub.h"),
AUDIT_STUB,
)
PACKAGE = Package(
"dlltracer",
PyFile("dlltracer/__init__.py"),
PYD,
source="src",
)
def init_PACKAGE(wheel_tag):
if wheel_tag and not wheel_tag.startswith("cp37"):
PYD.members.remove(AUDIT_STUB)