diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-12-15 13:40:15 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-12-15 13:51:14 +0300 |
commit | 00290ddef6c340575898974c63e57975e3866b75 (patch) | |
tree | c20aa1c307deb3c658b5f86689f35a8be0ede8db /project/os.py | |
parent | workflows/basic: minor fix (diff) | |
download | cmake-common-00290ddef6c340575898974c63e57975e3866b75.tar.gz cmake-common-00290ddef6c340575898974c63e57975e3866b75.zip |
basic macOS support
I don't have a Mac to test on, but the knowledge that there is basic
support for macOS is still nice.
Diffstat (limited to 'project/os.py')
-rw-r--r-- | project/os.py | 5 |
1 files changed, 4 insertions, 1 deletions
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(): |