MCPcopy Create free account
hub / github.com/doldecomp/mkdd / generate_objdiff_config

Function generate_objdiff_config

tools/project.py:1553–1779  ·  view source on GitHub ↗
(
    config: ProjectConfig,
    objects: Dict[str, Object],
    build_config: Optional[BuildConfig],
)

Source from the content-addressed store, hash-verified

1551
1552# Generate objdiff.json
1553def generate_objdiff_config(
1554 config: ProjectConfig,
1555 objects: Dict[str, Object],
1556 build_config: Optional[BuildConfig],
1557) -> None:
1558 if build_config is None:
1559 return
1560
1561 # Load existing objdiff.json
1562 existing_units = {}
1563 if Path("objdiff.json").is_file():
1564 with open("objdiff.json", "r", encoding="utf-8") as r:
1565 existing_config = json.load(r)
1566 existing_units = {unit["name"]: unit for unit in existing_config["units"]}
1567
1568 if config.ninja_path:
1569 ninja = str(config.ninja_path.absolute())
1570 else:
1571 ninja = "ninja"
1572
1573 objdiff_config: Dict[str, Any] = {
1574 "min_version": "2.0.0-beta.5",
1575 "custom_make": ninja,
1576 "build_target": False,
1577 "watch_patterns": [
1578 "*.c",
1579 "*.cc",
1580 "*.cp",
1581 "*.cpp",
1582 "*.cxx",
1583 "*.c++",
1584 "*.h",
1585 "*.hh",
1586 "*.hp",
1587 "*.hpp",
1588 "*.hxx",
1589 "*.h++",
1590 "*.pch",
1591 "*.pch++",
1592 "*.inc",
1593 "*.py",
1594 "*.yml",
1595 "*.txt",
1596 "*.json",
1597 ],
1598 "units": [],
1599 "progress_categories": [],
1600 }
1601
1602 # decomp.me compiler name mapping
1603 COMPILER_MAP = {
1604 "GC/1.0": "mwcc_233_144",
1605 "GC/1.1": "mwcc_233_159",
1606 "GC/1.1p1": "mwcc_233_159p1",
1607 "GC/1.2.5": "mwcc_233_163",
1608 "GC/1.2.5e": "mwcc_233_163e",
1609 "GC/1.2.5n": "mwcc_233_163n",
1610 "GC/1.3": "mwcc_242_53",

Callers 1

generate_buildFunction · 0.85

Calls 8

openFunction · 0.85
add_unitFunction · 0.85
add_categoryFunction · 0.85
cleandictFunction · 0.85
absoluteMethod · 0.80
loadMethod · 0.45
appendMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected