|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Functions | |
| objects (build_dir) | |
| load_allowlist (path) | |
| mangled_symbols (nm, path) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| MANGLED = re.compile(r'^_{1,2}Z') | |
| CMAKE_PROBE = re.compile(r'CMakeFiles/\d') | |
Lists the C++-mangled symbols defined by the object files of a build.
python3 scripts/check_c_linkage.py <build_dir> [--nm NM] [--allowlist FILE]
The data blobs, the .S files and the --defsym aliases refer to the engine's
symbols by their C names, so a function or a global compiled as C++ without C
linkage (a _Z... name) breaks them. Exits with 0 when no object defines a
mangled global symbol other than those in the allowlist (one name per line,
or re:<regex>; # comments; default test/c_linkage_allowlist.txt). The objects
of the targets in check_duplicates.PLUS_TARGETS (CoD2rev-Plus's C++ code,
libcod and its bridges) are skipped: their C++ names are meant to be C++.
| check_c_linkage.load_allowlist | ( | path | ) |
(names, regexes) from an allowlist file.
| check_c_linkage.main | ( | ) |
| check_c_linkage.mangled_symbols | ( | nm, | |
| path ) |
| check_c_linkage.objects | ( | build_dir | ) |
| check_c_linkage.CMAKE_PROBE = re.compile(r'CMakeFiles/\d') |
| check_c_linkage.MANGLED = re.compile(r'^_{1,2}Z') |
| check_c_linkage.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |