-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_lib.py
More file actions
35 lines (26 loc) · 1.13 KB
/
Copy pathbuild_lib.py
File metadata and controls
35 lines (26 loc) · 1.13 KB
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
#!/usr/bin/env python3
# SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
"""Build the hardware_monitor_cpp core static library (and the hardware_monitor_cpp_dump example).
Usage: python build_lib.py
On Windows the matching signed PawnIO module is installed next to the built
example so `hardware_monitor_cpp_dump` can read CPU temperature/power out of the box.
"""
import os
import sys
from build_common import ROOT, cmake_build, find_output, install_pawnio
def main():
build_dir = cmake_build(".", "build")
lib = find_output(build_dir, ["hardware_monitor_cpp.lib", "libhardware_monitor_cpp.a"])
dump = find_output(build_dir, ["hardware_monitor_cpp_dump.exe", "hardware_monitor_cpp_dump"])
if dump:
# Modules must sit next to the executable that loads them.
install_pawnio(os.path.dirname(dump))
print("\n[+] Library build complete.")
if lib:
print(f" static library : {lib}")
if dump:
print(f" example dump : {dump}")
print(f" public headers : {os.path.join(ROOT, 'include', 'hardware_monitor_cpp')}")
return 0
if __name__ == "__main__":
sys.exit(main())