Compare commits

...

4 Commits

Author SHA1 Message Date
b32c5cb81a update 2024-04-20 23:30:31 +08:00
08d48316b6 update 2024-04-20 22:49:36 +08:00
37b97de5e6 update 2024-04-20 22:25:19 +08:00
d4ad54915b update 2024-04-20 20:36:27 +08:00
6 changed files with 13 additions and 16 deletions

3
.gitignore vendored
View File

@ -10,4 +10,5 @@ __pycache__/
/main.cxx
/build
/build
/poetry.lock

View File

@ -1,3 +1,3 @@
from .lib.values import *
from .lib.cmake import *
from .lib.tools import *
from .values import *
from .cmake import *
from .tools import *

View File

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

View File

@ -1,6 +1,5 @@
from .tools import *
from .values import *
class cmake:
__write_stack:"list[str]" = []
__file_name = ""
@ -56,4 +55,8 @@ class cmake:
def file(self,new_var_name:"str",mode:"str"=glob_recurse,*search_str:"str")->"cmake":
self.__write_stack.append(f"file({mode} {new_var_name} {args_to_str(search_str)})")
return self
def add_subdirectory(self,path:str)->'cmake':
self.__write_stack.append(f"add_subdirectory({path})")
return self

View File

@ -1,4 +1,4 @@
cmake_export_compile_cmmands = "CMAKE_EXPORT_COMPILE_COMMANDS"
cmake_export_compile_commands = "CMAKE_EXPORT_COMPILE_COMMANDS"
project_name="PROJECT_NAME"
public = "PUBLIC"
static = "STATIC"
@ -13,4 +13,5 @@ o3 = "-O3"
o2 = "-O2"
cmake_cxx_flags_release = "CMAKE_CXX_FLAGS_RELEASE"
cmake_cxx_flags_debug = "CMAKE_CXX_FLAGS_DEBUG"
on="ON"
on="ON"
project_source_dir = "PROJECT_SOURCE_DIR"