This commit is contained in:
ZtRXR 2024-04-12 23:59:18 +08:00
parent 8d97e53419
commit 9fbb0b8d29
3 changed files with 19 additions and 3 deletions

8
.gitignore vendored
View File

@ -4,4 +4,10 @@
# Ignore all __pycache__ directories in the project # Ignore all __pycache__ directories in the project
__pycache__/ __pycache__/
/.vscode /.vscode
/CMakeLists.txt
/main.cxx
/build

9
pymake/__main__.py Normal file
View File

@ -0,0 +1,9 @@
from . import *
(
cmake("3.5")
.project("test")
.file("SRC",glob_recurse,"*.cxx")
.add_executable(var(project_name),var("SRC"))
.write()
)

View File

@ -1,7 +1,8 @@
def var(name:"str")->"str": from typing import *
def var(name:str)->str:
return f"${{{name}}}" return f"${{{name}}}"
def args_to_str(args:"list[str]")->str: def args_to_str(args:list[str])->str:
vars_str = "" vars_str = ""
for i in args: for i in args:
vars_str=f"{vars_str} {i}" vars_str=f"{vars_str} {i}"