19 lines
508 B
Python
19 lines
508 B
Python
# build/compiler/base.py
|
|
from abc import ABC, abstractmethod
|
|
from pathlib import Path
|
|
|
|
class Compiler(ABC):
|
|
exe = None
|
|
|
|
def __init__(self, exe: str | None = None):
|
|
if exe:
|
|
self.exe = exe
|
|
|
|
@abstractmethod
|
|
def compile(self, src: Path, out: Path, flags: list[str], extra_defines: list[str] | None = None, deps_out: Path | None = None) -> Path:
|
|
...
|
|
|
|
@abstractmethod
|
|
def link(self, objects: list[Path], output: Path, libs: list[str] | None = None):
|
|
...
|