setup: Use subprocess.check_call instead of os.system

This commit is contained in:
Léo Lam 2021-07-22 22:07:25 +02:00
parent d37951ab72
commit bc5593aa44
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 3 additions and 2 deletions

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import platform import platform
from pathlib import Path from pathlib import Path
import subprocess
import sys import sys
import tarfile import tarfile
import tempfile import tempfile
@ -74,7 +74,8 @@ def create_build_dir():
print("build directory already exists: nothing to do") print("build directory already exists: nothing to do")
return return
os.system("cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=toolchain/ToolchainNX64.cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -B build/") subprocess.check_call(
"cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=toolchain/ToolchainNX64.cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -B build/".split(" "))
print(">>> created build directory") print(">>> created build directory")