Initial Commit

This commit is contained in:
2025-07-07 14:12:53 +12:00
commit fc07e157c8
7 changed files with 640 additions and 0 deletions

36
util/builder/info.py Normal file
View File

@@ -0,0 +1,36 @@
from dataclasses import dataclass, field
from enum import Enum
from typing import List
class BuildType(Enum):
DEBUG: List[str] = ["-g", "-O0", "-DLOG_LEVEL=DEBUG"]
TRACE: List[str] = ["-g", "-O0", "-DLOG_LEVEL=TRACE"]
RELEASE: List[str] = ["-O3", "-DREL_BUILD", "-DLOG_LEVEL=ERROR"]
PROFILE: List[str] = ["-O2", "-g", "-pg", "-DLOG_LEVEL=ERROR"]
RELWITHDEBINFO: List[str] = ["-O2", "-g", "-DLOG_LEVEL=DEBUG"]
FASTEST: List[str] = ["-Ofast", "-ffast-math", "-xHost", "-DLOG_LEVEL=ERROR"]
@dataclass
class PlatformInfo:
name: str
compiler: str
architecture: str
file_type: str
code_specification: str
def __str__(self):
return f"{self.name}_{self.architecture}{self.file_type}"
class Platform(Enum):
LINUX_x86_64 = PlatformInfo("linux", "clang", "x86-64", "", "-DSPEC_LINUX")
LINUX_x86 = PlatformInfo("linux", "clang", "x86", "", "-DSPEC_LINUX")
LINUX_x86_64_V4 = PlatformInfo("linux", "clang", "x86-64-v4", "", "-DSPEC_LINUX")
MACOS = PlatformInfo("macos", "gcc", "arm", "", "-DSPEC_DARWIN")
@dataclass
class Build:
name: str
type: BuildType
platform: PlatformInfo
additional_instructions: List[str] = field(default_factory=list)