Skip to content

Commit 0f8cffa

Browse files
authored
fix: avoiding an extra system call (#279)
Signed-off-by: Henry Schreiner <[email protected]> Signed-off-by: Henry Schreiner <[email protected]>
1 parent 159e1cd commit 0f8cffa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cmake/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# -*- coding: utf-8 -*-
22
import os
3-
import platform
43
import subprocess
54
import sys
65

@@ -17,7 +16,7 @@
1716
from skbuild.constants import CMAKE_INSTALL_DIR as SKBUILD_CMAKE_INSTALL_DIR
1817
from skbuild.constants import set_skbuild_plat_name
1918

20-
if platform.system().lower() == "darwin":
19+
if sys.platform.startswith("darwin"):
2120
# Since building the project specifying --plat-name or CMAKE_OSX_* variables
2221
# leads to different SKBUILD_DIR, the code below attempt to guess the most
2322
# likely plat-name.
@@ -31,7 +30,7 @@
3130
if os.path.exists(_cmake_data):
3231
CMAKE_DATA = _cmake_data
3332

34-
if platform.system().lower() == "darwin":
33+
if sys.platform.startswith("darwin"):
3534
CMAKE_DATA = os.path.join(CMAKE_DATA, 'CMake.app', 'Contents')
3635

3736
CMAKE_BIN_DIR = os.path.join(CMAKE_DATA, 'bin')

0 commit comments

Comments
 (0)