diff options
Diffstat (limited to 'project')
-rw-r--r-- | project/boost/build.py | 2 | ||||
-rw-r--r-- | project/os.py | 5 | ||||
-rw-r--r-- | project/utils.py | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/project/boost/build.py b/project/boost/build.py index a192585..fd73b6e 100644 --- a/project/boost/build.py +++ b/project/boost/build.py @@ -101,7 +101,7 @@ class BuildParameters: logging.warning("Cannot link the runtime statically to a dynamic library, going to link dynamically") runtime_link = Linkage.SHARED elif on_linux_like(): - logging.warning("Cannot link to the GNU C Library (which is assumed) statically, going to link dynamically") + logging.warning("Cannot link to the GNU C Library or BSD libc (which are assumed) statically, going to link dynamically") runtime_link = Linkage.SHARED yield link, runtime_link diff --git a/project/os.py b/project/os.py index eaa63db..cb5bd44 100644 --- a/project/os.py +++ b/project/os.py @@ -11,6 +11,7 @@ class OS(Enum): WINDOWS = 'Windows' LINUX = 'Linux' CYGWIN = 'Cygwin' + MACOS = 'macOS' def __str__(self): return str(self.value) @@ -22,6 +23,8 @@ class OS(Enum): return OS.WINDOWS if system == 'Linux': return OS.LINUX + if system == 'Darwin': + return OS.MACOS if system.startswith('CYGWIN_NT'): return OS.CYGWIN raise NotImplementedError(f'unsupported OS: {system}') @@ -42,7 +45,7 @@ def on_linux(): def on_linux_like(): os = OS.current() - return os is OS.LINUX or os is OS.CYGWIN + return os is OS.LINUX or os is OS.CYGWIN or os is OS.MACOS def on_cygwin(): diff --git a/project/utils.py b/project/utils.py index 39dfb0d..6697ff7 100644 --- a/project/utils.py +++ b/project/utils.py @@ -13,7 +13,7 @@ import sys import tempfile import time -from project.os import on_cygwin, on_linux +import project.os def normalize_path(s): @@ -25,7 +25,7 @@ def mkdir_parent(path): def full_exe_name(exe): - if on_linux(): + if not project.os.on_windows_like(): # There's no PATHEXT on Linux. return exe # b2 on Windows/Cygwin doesn't like it when the executable name doesn't @@ -34,7 +34,7 @@ def full_exe_name(exe): path = shutil.which(exe, path=dir_path) if not path: raise RuntimeError(f"executable '{exe}' could not be found") - if on_cygwin(): + if project.os.on_cygwin(): # On Cygwin, shutil.which('gcc') == '/usr/bin/gcc' and shutil.which('gcc.exe') # == '/usr/bin/gcc.exe'; we want the latter version. shutil.which('clang++') # == '/usr/bin/clang++' is fine though, since it _is_ the complete path |