gcc: support without command line tools (#11040)
This commit is contained in:
parent
2d144316a8
commit
8cef81363c
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
from spack.architecture import OperatingSystem
|
from spack.architecture import OperatingSystem
|
||||||
from spack.version import Version
|
from spack.version import Version
|
||||||
|
from spack.util.executable import Executable
|
||||||
|
|
||||||
|
|
||||||
# FIXME: store versions inside OperatingSystem as a Version instead of string
|
# FIXME: store versions inside OperatingSystem as a Version instead of string
|
||||||
@ -16,6 +17,13 @@ def macos_version():
|
|||||||
return Version('.'.join(py_platform.mac_ver()[0].split('.')[:2]))
|
return Version('.'.join(py_platform.mac_ver()[0].split('.')[:2]))
|
||||||
|
|
||||||
|
|
||||||
|
def macos_sdk_path():
|
||||||
|
"""Return SDK path
|
||||||
|
"""
|
||||||
|
xcrun = Executable('xcrun')
|
||||||
|
return xcrun('--show-sdk-path', output=str, error=str).rstrip()
|
||||||
|
|
||||||
|
|
||||||
class MacOs(OperatingSystem):
|
class MacOs(OperatingSystem):
|
||||||
"""This class represents the macOS operating system. This will be
|
"""This class represents the macOS operating system. This will be
|
||||||
auto detected using the python platform.mac_ver. The macOS
|
auto detected using the python platform.mac_ver. The macOS
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
from spack.operating_systems.mac_os import macos_version
|
from spack.operating_systems.mac_os import macos_version, macos_sdk_path
|
||||||
from llnl.util import tty
|
from llnl.util import tty
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
@ -315,6 +315,12 @@ def configure_args(self):
|
|||||||
'--disable-bootstrap',
|
'--disable-bootstrap',
|
||||||
'--disable-multilib'])
|
'--disable-multilib'])
|
||||||
|
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
options.extend([
|
||||||
|
'--with-native-system-header-dir=/usr/include',
|
||||||
|
'--with-sysroot={0}'.format(macos_sdk_path())
|
||||||
|
])
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
||||||
# run configure/make/make(install) for the nvptx-none target
|
# run configure/make/make(install) for the nvptx-none target
|
||||||
|
Loading…
Reference in New Issue
Block a user