OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
check_duplicates Namespace Reference

Functions

 link_objects (build_dir, target)
 strong_globals (nm, path)
 main ()

Variables

tuple PLUS_TARGETS
 MANGLED = re.compile(r'^_{1,2}Z')
str REFPTR = '.refptr.'
 STRONG = set('BDRT')

Detailed Description

Lists the C names an executable gets both from CoD2rev-Plus and from the engine.

    python3 scripts/check_duplicates.py <build_dir> <target> [--nm NM]

The objects of the targets in PLUS_TARGETS (cod2_plus_script and its game,
core and dedicated variants, cod2_plus_server, cod2_plus_server_client and
cod2_plus_libcod: CoD2rev-Plus's code and its bridges) define globals by their C names, and the
data blobs must leave those to them. MinGW links with
--allow-multiple-definition, so a blob that still defines one wins without an
error. Reads the objects the target links (CMakeFiles/<target>.dir/objects*.rsp,
or the .o/.obj files in its link.txt) and exits with 0 when no unmangled global
is defined both by a CoD2rev-Plus object and by another one.

Function Documentation

◆ link_objects()

check_duplicates.link_objects ( build_dir,
target )

◆ main()

check_duplicates.main ( )

◆ strong_globals()

check_duplicates.strong_globals ( nm,
path )

Variable Documentation

◆ MANGLED

check_duplicates.MANGLED = re.compile(r'^_{1,2}Z')

◆ PLUS_TARGETS

tuple check_duplicates.PLUS_TARGETS
Initial value:
1= ('cod2_plus_script.dir', 'cod2_plus_script_game.dir', 'cod2_plus_script_core.dir',
2 'cod2_plus_script_ded.dir', 'cod2_plus_server.dir', 'cod2_plus_server_client.dir',
3 'cod2_plus_libcod.dir')

◆ REFPTR

str check_duplicates.REFPTR = '.refptr.'

◆ STRONG

check_duplicates.STRONG = set('BDRT')