* Make Google Test optional * Download googletest with brew * Set gtest and gmock lib vars in Libraries.cmake * Fixed cmake format * Add googletest-devel for openSUSE * Fixed missing Meson arg for Windows * Add gmock-devel for openSUSE * Fixed openSUSE package names * Fixed openSUSE package names (correct OS) * Add success message to disambiguate confusing messages * Restore original gtest lib var for subproject * Make WinToast optional * Fixed formatting * Fixed cmake format * Only build WinToast sources if found
33 lines
669 B
Python
33 lines
669 B
Python
import lib.cmd_utils as cmd_utils
|
|
import lib.env as env
|
|
import os
|
|
|
|
build_dir = "build/meson"
|
|
meson_bin = env.get_python_executable("meson")
|
|
|
|
|
|
def setup():
|
|
cmd = [meson_bin, "setup", build_dir]
|
|
|
|
if env.is_windows():
|
|
cmd.append("-Dsystem_gtest=false")
|
|
|
|
if os.path.exists(build_dir):
|
|
cmd.append("--reconfigure")
|
|
|
|
cmd_utils.run(cmd, print_cmd=True)
|
|
|
|
|
|
def compile():
|
|
cmd_utils.run([meson_bin, "compile", "-C", build_dir], print_cmd=True)
|
|
|
|
|
|
def install():
|
|
cmd = [meson_bin, "install", "-C", build_dir]
|
|
|
|
has_sudo = cmd_utils.has_command("sudo")
|
|
if has_sudo:
|
|
cmd.insert(0, "sudo")
|
|
|
|
cmd_utils.run(cmd, print_cmd=True)
|