mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Fix command detection when a command string contains multiple words.
This commit is contained in:
@@ -12,6 +12,7 @@ from os.path import relpath, splitext, join, basename, isfile
|
||||
from glob import iglob
|
||||
import fnmatch
|
||||
import subprocess
|
||||
import shutil
|
||||
|
||||
|
||||
def filenamesmatchingof(xs, pattern):
|
||||
@@ -52,6 +53,11 @@ def itemsof(pattern, root=None, cwd=None):
|
||||
return result
|
||||
|
||||
|
||||
def does_command_exist(cmd):
|
||||
basecmd = cmd.strip().split()[0]
|
||||
return shutil.which(basecmd)
|
||||
|
||||
|
||||
def shell(args):
|
||||
r = subprocess.check_output(args)
|
||||
return r.decode("utf-8").strip()
|
||||
|
||||
@@ -1,25 +1,19 @@
|
||||
from build.ab import simplerule, G
|
||||
from build.c import cxxprogram
|
||||
from build.utils import shell
|
||||
from build.utils import shell, does_command_exist
|
||||
from glob import glob
|
||||
import config
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
G.setdefault("WX_CONFIG", "wx-config")
|
||||
assert shutil.which(G.WX_CONFIG), "Required binary 'wx-config' not found"
|
||||
assert does_command_exist(G.WX_CONFIG), "Required binary 'wx-config' not found"
|
||||
|
||||
G.setdefault(
|
||||
"WX_CFLAGS",
|
||||
shell(
|
||||
[G.WX_CONFIG, "--cxxflags", "base", "adv", "aui", "richtext", "core"]
|
||||
),
|
||||
shell([G.WX_CONFIG, "--cxxflags", "base", "adv", "aui", "richtext", "core"]),
|
||||
)
|
||||
G.setdefault(
|
||||
"WX_LDFLAGS",
|
||||
shell(
|
||||
[G.WX_CONFIG, "--libs", "base", "adv", "aui", "richtext", "core"]
|
||||
)
|
||||
shell([G.WX_CONFIG, "--libs", "base", "adv", "aui", "richtext", "core"]),
|
||||
)
|
||||
|
||||
extrasrcs = ["./layout.cpp"]
|
||||
|
||||
Reference in New Issue
Block a user