PonyPlayer
build 命名空间参考

函数

def execute (str command)
 

变量

 parser = ArgumentParser(description="Build cmake project.")
 
 group = parser.add_mutually_exclusive_group()
 
 help
 
 action
 
 args = parser.parse_args()
 
 self_path = pathlib.Path(sys.argv[0]).absolute()
 
string build_dir = self_path.absolute().parent.parent / "build"
 
 exist_ok
 
 encoding
 
 conf = json.load(f)
 
 qt_path = conf["qt_path"].replace("\\", "/")
 
 ninja_path = conf['ninja_path'].replace("\\", "/")
 
 compiler_path = conf['compiler_path'].replace("\\", "/")
 
 toolset = os.path.join(qt_path, "lib/cmake/Qt6/qt.toolchain.cmake")
 
string os_dependent_args = "-DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS} -mwindows\" -DWITH_WINDOWS_ICON=ON"
 
string cmake_command = f"cmake " \
 
string command = f"cd {build_dir} " \
 
 modify_environment = os.environ.copy()
 
 p = subprocess.Popen(command, shell=True, env=modify_environment)
 

函数说明

◆ execute()

def build.execute ( str  command)

变量说明

◆ action

build.action

◆ args

build.args = parser.parse_args()

◆ build_dir

string build.build_dir = self_path.absolute().parent.parent / "build"

◆ cmake_command

string build.cmake_command = f"cmake " \

◆ command

string build.command = f"cd {build_dir} " \

◆ compiler_path

build.compiler_path = conf['compiler_path'].replace("\\", "/")

◆ conf

build.conf = json.load(f)

◆ encoding

build.encoding

◆ exist_ok

build.exist_ok

◆ group

build.group = parser.add_mutually_exclusive_group()

◆ help

build.help

◆ modify_environment

build.modify_environment = os.environ.copy()

◆ ninja_path

build.ninja_path = conf['ninja_path'].replace("\\", "/")

◆ os_dependent_args

string build.os_dependent_args = "-DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS} -mwindows\" -DWITH_WINDOWS_ICON=ON"

◆ p

build.p = subprocess.Popen(command, shell=True, env=modify_environment)

◆ parser

build.parser = ArgumentParser(description="Build cmake project.")

◆ qt_path

build.qt_path = conf["qt_path"].replace("\\", "/")

◆ self_path

build.self_path = pathlib.Path(sys.argv[0]).absolute()

◆ toolset

build.toolset = os.path.join(qt_path, "lib/cmake/Qt6/qt.toolchain.cmake")