- HandlerMinelayerData: BUILD_RTI Guards für RTI-Abhängigkeiten - svcTabCommon: Export-Header-Fix via Fallback-Target - TrainingAreaBase: Stub-Header für BUILD_RTI=OFF - ddsfts: Include-Pfad und Dependency-Fixes - BUILD_RTI=OFF Compilation vollständig unterstützt Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Entire-Checkpoint: 01M0JNZA586SACX1PRZ2DJAE5S
50 lines
1.8 KiB
Python
50 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Fix include paths for project_defines.h
|
|
Changes: #include <Common/ProjectConfig/project_defines.h>
|
|
to: #include <Lts/Common/ProjectConfig/project_defines.h>
|
|
"""
|
|
|
|
import os
|
|
import re
|
|
import sys
|
|
|
|
def fix_includes(root_dir):
|
|
"""Fix include paths in all .h and .cpp files"""
|
|
pattern = re.compile(r'#include\s*<Common/ProjectConfig/project_defines\.h>')
|
|
replacement = '#include <Lts/Common/ProjectConfig/project_defines.h>'
|
|
|
|
files_fixed = 0
|
|
|
|
for dirpath, dirnames, filenames in os.walk(root_dir):
|
|
# Skip hidden directories and build directories
|
|
if '.git' in dirpath or 'build' in dirpath:
|
|
continue
|
|
|
|
for filename in filenames:
|
|
if filename.endswith(('.h', '.cpp', '.cc', '.cxx')):
|
|
filepath = os.path.join(dirpath, filename)
|
|
|
|
try:
|
|
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
|
|
content = f.read()
|
|
|
|
# Check if file needs fixing
|
|
if pattern.search(content):
|
|
new_content = pattern.sub(replacement, content)
|
|
|
|
with open(filepath, 'w', encoding='utf-8') as f:
|
|
f.write(new_content)
|
|
|
|
files_fixed += 1
|
|
print(f"Fixed: {filepath}")
|
|
|
|
except Exception as e:
|
|
print(f"Error processing {filepath}: {e}", file=sys.stderr)
|
|
|
|
print(f"\nTotal files fixed: {files_fixed}")
|
|
return files_fixed
|
|
|
|
if __name__ == '__main__':
|
|
root_dir = sys.argv[1] if len(sys.argv) > 1 else '.'
|
|
fix_includes(root_dir) |